Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/poolifier/src/mod.ts>Deque

Fast and small web worker pool
Latest
class Deque
import { Deque } from "https://deno.land/x/poolifier@v0.3.14/src/mod.ts";

Deque. Implemented with a doubly linked list.

Constructors

new
Deque()

Properties

private
optional
head: ILinkedListNode<T>
private
optional
tail: ILinkedListNode<T>
maxSize: number

The maximum size of the deque.

size: number

The size of the deque.

Methods

private
incrementSize(): number
backward(): Iterable<T>

Returns an backward iterator for the deque.

clear(): void

Clears the deque.

peekFirst(): T | undefined

Peeks at the first data.

peekLast(): T | undefined

Peeks at the last data.

pop(): T | undefined

Pops data from the deque.

push(data: T): number

Appends data to the deque.

shift(): T | undefined

Shifts data from the deque.

unshift(data: T): number

Prepends data to the deque.

[Symbol.iterator](): Iterator<T>

Returns an iterator for the deque.