I’ve a use case where a producer emits elements at random intervals. I want the consumer to wait for a certain time, then give up (timeout) and close the channel. Currently, I’m doing this using a buffered channel, where the consumer loops over the channel within a
Having heard that flows are rad, I’m wondering if this is possible using a flow. The problem is, once the consumer gets hold of the flow reference (immediately), there’s no way for the producer to emit more values into it (like
channel.send), so the consumer always times out receiving nothing. It’s almost as if I need a deferred emit that can keep appending to the flow (like a queue).