(timeout)
| 6274 | } |
| 6275 | |
| 6276 | async once(timeout) { |
| 6277 | let result = await this.next(timeout); |
| 6278 | if (result.done) { |
| 6279 | // If stream was ended, this function should never resolve. |
| 6280 | await new Promise(() => {}); |
| 6281 | } |
| 6282 | return result.value; |
| 6283 | } |
| 6284 | |
| 6285 | createConsumer() { |
| 6286 | throw new TypeError('Method must be overriden by subclass'); |