Repository navigation
Add primitives for waiting on I/O with timeout - #227
Conversation
- Timer.init() now accepts Timeout (none/duration/deadline) instead of Duration - .none sets delay to Duration.max (effectively infinite) - .deadline pre-sets the deadline timestamp, skipping delay calculation - timedWaitForIo() now accepts Timeout, handles .none by calling waitForIo directly - LoopState.setTimer() only computes deadline from delay if delay > 0
📝 WalkthroughWalkthroughThis PR changes Timer construction to accept Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/common.zig`:
- Around line 93-106: The current logic infers a timeout by checking c.err for
error.Canceled, which conflates real IO cancellations with timeout
cancellations; instead after waitForIo(rt, &group.c) check the timer completion
status (e.g., inspect timer.c.err / timer result) to see if the timer finished
successfully and only then return error.Timeout, otherwise propagate c.err from
the IO callback (c) as the true IO error; update the logic around
ev.Timer.init(timeout), group.add(&timer.c), and the post-wait check in the
waitForIo handling to use timer.c (not c.err) to detect timeout.
No description provided.