DelayQueue.d.ts 479 B

1234567891011121314151617181920
  1. export interface DelayQueueOptions {
  2. callback?: Function;
  3. timeout: number;
  4. }
  5. /**
  6. * Queue that runs items after specified duration
  7. */
  8. export default class DelayQueue {
  9. private queues;
  10. private timeouts;
  11. /**
  12. * Add a new item to the queue
  13. *
  14. * @param bucket bucket name
  15. * @param item function that will run later
  16. * @param options
  17. */
  18. push(bucket: string, item: Function, options: DelayQueueOptions): void;
  19. private execute;
  20. }