Type Alias QueueOpts<V>

QueueOpts<V>: {
    capacity?: number;
    discardPolicy?: QueueDiscardPolicy;
    eq?: IsEqual<V>;
}

Queue options.

Type Parameters

  • V

Type declaration

  • Optional Readonlycapacity?: number

    Capcity limit

  • Optional ReadonlydiscardPolicy?: QueueDiscardPolicy

    Default is additions, meaning new items are discarded.

    older: Removes items front of the queue (ie older items are discarded)

    newer: Remove from rear of queue to make space for new items (ie newer items are discarded)

    additions: Only adds new items that there are room for (ie. brand new items are discarded)

  • Optional Readonlyeq?: IsEqual<V>
const q = Queues.mutable({capacity: 5, discardPolicy: `newer`});