Fixing the Consumer in a Producer/Consumer Effect Pattern
Hello everyone, I'm playing around with Effect a bit and I'm trying to get a basic producer/consumer example working, but I'm not entirely sure how to best do it. So far, I have the following code:
Essentially, I want to produce an item on a fixed time basis and consume as items are produced. Right now, I run the producer fiber on a 1-second basis, but if I try to just fork the consumer (without
Essentially, I want to produce an item on a fixed time basis and consume as items are produced. Right now, I run the producer fiber on a 1-second basis, but if I try to just fork the consumer (without
Effect.repeat) the program immediately terminates after 1 run (which makes sense, since I join at the end). How would it be possible to not have the repeat for the consumer?