Skip to content

ILossyQueue

Defined in: packages/data/src/queue/ilossy-queue.ts:14

The lossy sibling of IQueue: never throws or waits when a bounded queue is full, evicting or skipping instead (overflowPolicy).

"evict" drops the front (oldest) item to make room — the same victim Python’s deque(maxlen=N) and Boost’s circular_buffer pick, and the only meaningful choice for a FIFO structure.

T extends DefinedValue = DefinedValue

readonly capacity: number

Defined in: packages/data/src/collection/ibounded.ts:17

The maximum number of elements the collection can hold.

Note: Infinity is not a legal value here — an unbounded type omits this mixin.

ILossy.capacity


readonly overflowPolicy: OverflowPolicy

Defined in: packages/data/src/collection/ilossy.ts:20

Policy applied when the collection reaches its capacity.

ILossy.overflowPolicy

[iterator](): Iterator<T, any, any>

Defined in: node_modules/.store/typescript-npm-6.0.3-585eecd158/package/lib/lib.es2015.iterable.d.ts:47

Iterator<T, any, any>

IQueue.[iterator]


clear(): void

Defined in: packages/data/src/collection/icollection.ts:23

Removes all elements from the collection.

void

IQueue.clear


count(): number

Defined in: packages/data/src/collection/icollection.ts:20

The number of elements in the collection.

A method, not a getter: its async counterpart needs a round trip to the backing store, and a member must have the same shape in both.

number

IQueue.count


dequeue(): T | undefined

Defined in: packages/data/src/queue/iqueue.ts:38

Removes and returns the item at the front of the queue.

T | undefined

The item at the front of the queue, or undefined if the queue is empty.

IQueue.dequeue


enqueue(item): readonly T[]

Defined in: packages/data/src/queue/ilossy-queue.ts:22

Same as IQueue.enqueue, but never throws — returns the items dropped to make room (empty if nothing was dropped).

T

readonly T[]

IQueue.enqueue

IQueue.enqueue


enqueueAll(items): readonly T[]

Defined in: packages/data/src/queue/ilossy-queue.ts:30

Same as IQueue.enqueueAll, but never throws — returns the items dropped to make room (empty if nothing was dropped).

readonly T[]

readonly T[]

IQueue.enqueueAll

IQueue.enqueueAll


front(): T | undefined

Defined in: packages/data/src/queue/iqueue.ts:46

Returns the item at the front of the queue without removing it.

T | undefined

The item at the front of the queue, or undefined if the queue is empty.

IQueue.front