(value: T)
| 13 | private failed = false |
| 14 | |
| 15 | push(value: T): void { |
| 16 | if (this.ended || this.failed) return |
| 17 | const waiter = this.waiters.shift() |
| 18 | if (waiter) { |
| 19 | waiter.resolve({ value, done: false }) |
| 20 | } else { |
| 21 | this.values.push(value) |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | end(): void { |
| 26 | if (this.ended || this.failed) return |