|
|
@@ -8,8 +8,8 @@ export default class AsyncQueue {
|
|
8
|
8
|
* Creates new instance.
|
|
9
|
9
|
*/
|
|
10
|
10
|
constructor() {
|
|
11
|
|
- this.modificationQueue = async.queue(this._processQueueTasks.bind(this), 1);
|
|
12
|
|
- this.stopped = false;
|
|
|
11
|
+ this._queue = async.queue(this._processQueueTasks.bind(this), 1);
|
|
|
12
|
+ this._stopped = false;
|
|
13
|
13
|
}
|
|
14
|
14
|
|
|
15
|
15
|
/**
|
|
|
@@ -37,12 +37,12 @@ export default class AsyncQueue {
|
|
37
|
37
|
* @param {function} [callback] - Optional callback to be called after the task has been executed.
|
|
38
|
38
|
*/
|
|
39
|
39
|
push(workFunction, callback) {
|
|
40
|
|
- if (this.stopped) {
|
|
|
40
|
+ if (this._stopped) {
|
|
41
|
41
|
callback && callback('The queue has been stopped');
|
|
42
|
42
|
|
|
43
|
43
|
return;
|
|
44
|
44
|
}
|
|
45
|
|
- this.modificationQueue.push(workFunction, callback);
|
|
|
45
|
+ this._queue.push(workFunction, callback);
|
|
46
|
46
|
}
|
|
47
|
47
|
|
|
48
|
48
|
/**
|
|
|
@@ -50,6 +50,6 @@ export default class AsyncQueue {
|
|
50
|
50
|
* after the queue has been shutdown then the callback will be called with an error.
|
|
51
|
51
|
*/
|
|
52
|
52
|
shutdown() {
|
|
53
|
|
- this.stopped = true;
|
|
|
53
|
+ this._stopped = true;
|
|
54
|
54
|
}
|
|
55
|
55
|
}
|