Processing items from a queue with an Effect
I have an Effect which runs for a while and puts stuff in a queue. I'd like to pull and process the items in that queue for as long as:
1. There are items in the queue, and
2. The queue is still being filled
I understand that I can track (2) with
1. There are items in the queue, and
2. The queue is still being filled
I understand that I can track (2) with
Deffered or Ref (open to recs on which is generally the more correct fit, or if some other approach is better), but I'm not sure of the best way to write the code for processing the items from the queue. My initial thought was that something like Effect.whileLoop would be correct, but the predicate is not effectful and accepts no parameters.