Commit 0270461
fix(client): abort-on-close watcher busy-spins while events are pending (#101)
The watcher added in #98 waited with `wait(stream_to); yield()` in a loop.
`wait(::Channel)` returns as soon as data is *available*, so whenever an
event sits in the channel before the consumer takes it, the loop spins hot
— measured at 100% of a core in system time on a k8s watch stream. Poll
`isopen` with a 250ms sleep instead; the watcher only exists to abort the
read when the consumer walks away, so the added abort latency is irrelevant.
Bumps to 0.2.6.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent 39c46f6 commit 0270461
2 files changed
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
376 | 382 | | |
377 | | - | |
378 | | - | |
| 383 | + | |
379 | 384 | | |
380 | 385 | | |
381 | 386 | | |
| |||
0 commit comments