I have maybe a simple question, but how can I make a call to a GenStage (with a producer and a consumer) where I can get the actual result of doing the computation? If I call to the producer, it doesn’t do the actual work it just buffers it, so it cannot return what I need.
If I call to the consumer where the actual work is happening, I’m not sure if it would be a bad idea to try to call the functions in handle_call
that are being called in handle_events
. I am also not sure if calling directly to the consumer interferes with the min/max limits.
I think a better option is to use the from
somehow, but I don’t think I understand how this works. How can my code receive a response from the GenStage consumer when it is done processing my message so I can know the response?
Sorry if I am not using the correct words.