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.takein a loop - Producer uses
Queue.offerwithout blocking
Loading code editor...