Repository navigation
Use individual xev.Completion per timeout - #121
Conversation
The experiment with using a single xev.Completion for all timeouts was not working, it's hard to keep them updated. By using a separate xev.Completion per timeout, we move the responsibility to libxev. This way, we can properly wait for the timeout to complete.
WalkthroughRefactored timeout handling from a centralized heap-based system to distributed per-Timeout timers. Removed shared timer fields from AnyTask and migrated timer/completion state into individual Timeout instances, replacing callback-driven timeout management with explicit timer-triggered task resumption. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ 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
🧹 Nitpick comments (1)
src/core/task.zig (1)
81-87: Docstring no longer matches what the code does.This helper now just updates
canceled_statusand returns a bool so the caller can decide whether to flag the timeout. Please refresh the comment so future readers aren't chasing an outdated description.
The experiment with using a single xev.Completion for all timeouts was not working, it's hard to keep them updated.
By using a separate xev.Completion per timeout, we move the responsibility to libxev.
This way, we can properly wait for the timeout to complete.