EffectTalk

Fork a consumer with Queue.take

Run a consumer in a forked fiber so it runs in the background. The consumer loops on Queue.take; the producer offers items. Decouple work without blocking the main flow.

  • Fork the consumer with Effect.fork(consumer(queue))
  • Consumer uses Queue.take in a loop
  • Producer uses Queue.offer without blocking
Loading code editor...