Shawn
8ec95a280c
fix(core): prevent infinite loop in drainEvents on closed channel ( #152 )
...
drainEvents uses a select loop with a default case to drain buffered
events. When the channel is closed, receives always succeed immediately
with a zero value, so the default case never triggers and the function
spins in an infinite loop, consuming 100% CPU.
Check the ok value from the receive and return immediately when the
channel is closed. Add regression tests for both closed and open
channel scenarios.
2026-03-15 19:19:53 +08:00
..
2026-03-15 18:20:07 +08:00
2026-03-05 20:56:38 +08:00
2026-03-04 12:38:37 +08:00
2026-03-14 18:54:48 +08:00
2026-03-14 18:54:48 +08:00
2026-03-11 07:52:36 +08:00
2026-03-14 08:46:38 +08:00
2026-03-07 07:55:24 +08:00
2026-03-14 15:40:00 +08:00
2026-03-14 11:18:45 +08:00
2026-03-06 15:25:08 +08:00
2026-03-06 15:25:08 +08:00
2026-03-13 17:21:14 +08:00
2026-03-15 19:19:53 +08:00
2026-03-15 19:19:53 +08:00
2026-03-14 11:58:53 +08:00
2026-03-14 11:58:53 +08:00
2026-03-04 12:38:37 +08:00
2026-03-05 20:56:38 +08:00
2026-03-15 11:22:47 +08:00
2026-03-13 15:28:33 +11:00
2026-03-14 18:46:52 +08:00
2026-03-14 18:46:52 +08:00
2026-03-14 15:40:00 +08:00
2026-03-14 15:40:00 +08:00
2026-03-01 09:36:37 +08:00
2026-03-13 16:40:58 +08:00
2026-03-12 19:38:58 +08:00
2026-03-04 23:57:13 +08:00
2026-03-15 07:41:48 +08:00
2026-03-15 07:41:48 +08:00
2026-03-05 20:56:38 +08:00
2026-03-04 12:38:37 +08:00
2026-03-05 20:56:38 +08:00
2026-02-28 10:38:24 +08:00
2026-03-13 08:03:14 -07:00
2026-03-15 14:21:15 +08:00
2026-03-15 14:21:15 +08:00
2026-03-14 15:40:00 +08:00
2026-03-09 16:55:55 +08:00
2026-03-07 09:02:19 +08:00
2026-03-14 15:40:00 +08:00
2026-03-13 09:54:16 -07:00
2026-03-14 17:30:36 +08:00
2026-03-14 17:30:36 +08:00
2026-03-05 20:56:38 +08:00
2026-03-06 17:07:20 +08:00
2026-03-14 11:33:59 +08:00
2026-03-14 11:33:59 +08:00
2026-03-12 19:38:58 +08:00
2026-03-12 19:38:58 +08:00
2026-03-12 19:38:58 +08:00
2026-03-12 19:38:58 +08:00