* Flush all, as quickly as possible * @return {Promise}
()
| 146 | * @return {Promise} |
| 147 | */ |
| 148 | flush() { |
| 149 | if (this.running) { |
| 150 | return this.running |
| 151 | } |
| 152 | |
| 153 | if (this._q.length) { |
| 154 | this.running = this.dequeue().then( |
| 155 | function () { |
| 156 | this.running = undefined |
| 157 | return this.flush() |
| 158 | }.bind(this), |
| 159 | ) |
| 160 | |
| 161 | return this.running |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | /** |
| 166 | * Clear all items in wait |