You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
479 B
21 lines
479 B
1 month ago
|
export interface DelayQueueOptions {
|
||
|
callback?: Function;
|
||
|
timeout: number;
|
||
|
}
|
||
|
/**
|
||
|
* Queue that runs items after specified duration
|
||
|
*/
|
||
|
export default class DelayQueue {
|
||
|
private queues;
|
||
|
private timeouts;
|
||
|
/**
|
||
|
* Add a new item to the queue
|
||
|
*
|
||
|
* @param bucket bucket name
|
||
|
* @param item function that will run later
|
||
|
* @param options
|
||
|
*/
|
||
|
push(bucket: string, item: Function, options: DelayQueueOptions): void;
|
||
|
private execute;
|
||
|
}
|