Skip to content

ItemQueue<T>

Unofficial

An async item queue that supports generator-based consumption.

Import:

import type { ItemQueue } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export interface ItemQueue<T>

Properties

Property Type Description
items ItemQueueItems<T> Backing storage for the queue items.
promise null | PromiseWithResolvers<T> Promise resolvers for awaiting the next item.
runnable Runnable Runnable controlling the queue's start/stop lifecycle.

Methods

Method Returns Description
add(item) void Add a single item to the queue.
addList(items) void Add multiple items to the queue.
cancel() void Cancel the queue and stop processing.
clear() void Remove all items from the queue.
generator() AsyncGenerator<T> Return an async generator that yields items as they are enqueued.
notify() void Notify the queue that a new item is available for consumption.
remove(item) void Remove a specific item from the queue.

Links to this page: