Defined in: async-queuer.ts:3
• TValue
optional addItemsTo: QueuePosition;
optional addItemsTo: QueuePosition;
Defined in: async-queuer.ts:8
Default position to add items to the queuer
'back'
'back'
optional concurrency: number;
optional concurrency: number;
Defined in: async-queuer.ts:12
Maximum number of concurrent tasks to process
optional expirationDuration: number;
optional expirationDuration: number;
Defined in: async-queuer.ts:17
Maximum time in milliseconds that an item can stay in the queue If not provided, items will never expire
optional getIsExpired: (item, addedAt) => boolean;
optional getIsExpired: (item, addedAt) => boolean;
Defined in: async-queuer.ts:22
Function to determine if an item has expired If provided, this overrides the expirationDuration behavior
() => Promise<TValue>
number
boolean
optional getItemsFrom: QueuePosition;
optional getItemsFrom: QueuePosition;
Defined in: async-queuer.ts:27
Default position to get items from during processing
'front'
'front'
optional getPriority: (item) => number;
optional getPriority: (item) => number;
Defined in: async-queuer.ts:33
Function to determine priority of items in the queuer Higher priority items will be processed first If not provided, will use static priority values attached to tasks
() => Promise<TValue>
number
optional initialItems: () => Promise<TValue> & object[];
optional initialItems: () => Promise<TValue> & object[];
Defined in: async-queuer.ts:37
Initial items to populate the queuer with
optional maxSize: number;
optional maxSize: number;
Defined in: async-queuer.ts:41
Maximum number of items allowed in the queuer
optional onExpire: (item, queuer) => void;
optional onExpire: (item, queuer) => void;
Defined in: async-queuer.ts:64
Callback fired whenever an item expires in the queuer
() => Promise<TValue>
AsyncQueuer<TValue>
void
optional onGetNextItem: (item, queuer) => void;
optional onGetNextItem: (item, queuer) => void;
Defined in: async-queuer.ts:45
Callback fired whenever an item is removed from the queuer
() => Promise<TValue>
AsyncQueuer<TValue>
void
optional onIsRunningChange: (queuer) => void;
optional onIsRunningChange: (queuer) => void;
Defined in: async-queuer.ts:52
Callback fired whenever the queuer's running state changes
AsyncQueuer<TValue>
void
optional onItemsChange: (queuer) => void;
optional onItemsChange: (queuer) => void;
Defined in: async-queuer.ts:56
Callback fired whenever an item is added or removed from the queuer
AsyncQueuer<TValue>
void
optional onReject: (item, queuer) => void;
optional onReject: (item, queuer) => void;
Defined in: async-queuer.ts:60
Callback fired whenever an item is rejected from being added to the queuer
() => Promise<TValue>
AsyncQueuer<TValue>
void
optional started: boolean;
optional started: boolean;
Defined in: async-queuer.ts:68
Whether the queuer should start processing tasks immediately or not.
optional wait: number;
optional wait: number;
Defined in: async-queuer.ts:72
Time in milliseconds to wait between processing items
Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.