Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/effection/lib/mod.ts>Queue

Structured concurrency and effects for JavaScript
Latest
interface Queue
implements Subscription<T, TClose>
Re-export
import { type Queue } from "https://deno.land/x/effection@4.0.0-alpha.1/lib/mod.ts";

A FIFO queue which can be used to implement the Subscription interface directly. Most of the time, you will use either a Signal or a Channel as the mechanism, but Queue allows you to manage a single subscription directly.

Methods

add(item: T): void

Add a value to the queue. The oldest value currently in the queue will be the first to be read.

close(value: TClose): void

Close the queue.