Skip to content

Commit

Permalink
feat: support global:progress event
Browse files Browse the repository at this point in the history
  • Loading branch information
stansv committed Aug 24, 2019
1 parent e47cc87 commit 60f4d85
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/classes/compat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8

import IORedis from 'ioredis';
import { EventEmitter } from 'events';
import { QueueEvents, Worker, Queue, QueueScheduler, Job } from '@src/classes';
import {
JobsOpts,
QueueOptions,
AdvancedOpts,
RepeatOpts,
QueueEventsOptions,
QueueSchedulerOptions,
Expand All @@ -51,8 +49,6 @@ export class Queue3<T = any> extends EventEmitter {
private worker: Worker;
private queueScheduler: QueueScheduler;

private readonly handlers: { [key: string]: Function } = {};

/**
* This is the Queue constructor.
* It creates a new Queue that is persisted in Redis.
Expand Down Expand Up @@ -685,6 +681,13 @@ export class Queue3<T = any> extends EventEmitter {
this.getQueueEvents().on('resumed', listener);
}
break;
case 'global:progress':
if (once) {
this.getQueueEvents().once('progress', listener);
} else {
this.getQueueEvents().on('progress', listener);
}
break;
case 'global:waiting':
if (once) {
this.getQueueEvents().once('waiting', listener);
Expand Down

0 comments on commit 60f4d85

Please sign in to comment.