Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/carriageway/src/queue.ts>Queue

🦥 Run async functions with limited concurrency and optional rate limiting
Go to Latest
class Queue
implements IQueue<T, R>
import { Queue } from "https://deno.land/x/carriageway@v0.8.1/src/queue.ts";

Constructors

new
Queue(options?: QueueOptions)

Properties

concurrency: number
readonly
length: number
readonly
pending: number
throttle: number
readonly
waiting: number

Methods

add(
item: T,
callback: QueueCallback<T, R>,
prepend?,
): Promise<R>

Add an item to the queue

append(item: T, callback: QueueCallback<T, R>): Promise<R>
clear(): void
get(item: T): Promise<R> | undefined
getPending(): Array<T>

Return active items

getWaiting(): Array<T>

Return queued items

has(item: T): boolean
prepend(item: T, callback: QueueCallback<T, R>): Promise<R>
sort(compare: (a: T, b: T) => number): void