Skip to content

ItemQueue<T>

Unofficial

An async item queue that supports generator-based consumption.

Import:

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

Signature:

export interface ItemQueue<T>

Properties

PropertyTypeDescription
itemsItemQueueItems<T>Backing storage for the queue items.
promisenull | PromiseWithResolvers<T>Promise resolvers for awaiting the next item.
runnableRunnableRunnable controlling the queue's start/stop lifecycle.

Methods

MethodReturnsDescription
add(item)voidAdd a single item to the queue.
addList(items)voidAdd multiple items to the queue.
cancel()voidCancel the queue and stop processing.
clear()voidRemove all items from the queue.
generator()AsyncGenerator<T>Return an async generator that yields items as they are enqueued.
notify()voidNotify the queue that a new item is available for consumption.
remove(item)voidRemove a specific item from the queue.

Links to this page: