import { createQueue } from "https://deno.land/x/effection@3.0.0-beta.3/lib/mod.ts";
Creates a new queue. Queues are unlimited in size and sending a message to a queue is always synchronous.
Examples
Example 1
Example 1
import { each, main, createQueue } from 'effection';
await main(function*() {
let queue = createQueue<number>();
queue.send(1);
queue.send(2);
queue.send(3);
let next = yield* queue.subscription.next();
while (!next.done) {
console.log("got number", next.value);
next = yield* queue.subscription.next();
}
});