(value: T)
| 14 | private failed = false |
| 15 | |
| 16 | push(value: T): void { |
| 17 | if (this.ended || this.failed) return |
| 18 | const waiter = this.waiters.shift() |
| 19 | if (waiter) { |
| 20 | waiter.resolve({ value, done: false }) |
| 21 | } else { |
| 22 | this.values.push(value) |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | /** Signal normal completion; pending and future reads resolve as done. */ |
| 27 | end(): void { |