Append streamed text; flush now if the throttle window elapsed, else mark dirty.
(delta: string)
| 36 | |
| 37 | /** Append streamed text; flush now if the throttle window elapsed, else mark dirty. */ |
| 38 | async push(delta: string): Promise<void> { |
| 39 | if (delta) this.buf += delta; |
| 40 | if (this.io.now() - this.lastFlushAt >= this.io.minIntervalMs) await this.flush(false); |
| 41 | else this.dirty = true; |
| 42 | } |
| 43 | |
| 44 | /** Drain any throttle-deferred text — call this on a timer between pushes. */ |
| 45 | async drain(): Promise<void> { |