(id, callback)
| 18 | } |
| 19 | |
| 20 | push(id, callback) { |
| 21 | if (this.stopping_) throw new Error('Cannot push task when queue is stopping'); |
| 22 | |
| 23 | this.waitingTasks_.push({ |
| 24 | id: id, |
| 25 | callback: callback, |
| 26 | }); |
| 27 | this.processQueue_(); |
| 28 | } |
| 29 | |
| 30 | processQueue_() { |
| 31 | if (this.processingQueue_ || this.stopping_) return; |