Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add wait_deadline function #226

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

joshyrobot
Copy link

A handy function if your code mostly relies on deadlines rather than timeouts.

Also changes the internal pollers to use deadlines and has them calculate timeouts just before the relevant syscall. This prevents a couple extra calls to Instant::now(), hypothetically makes the timeout more accurate, and in my opinion is a little bit easier to reason about.

(I only compiled and tested epoll so here's hoping CI goes well)

Pass around deadlines and only calculate timeouts
just before the relevant syscall. Prevents some
needless calls to `Instant::now()` and makes
`wait_deadline` simpler to implement.
@joshyrobot
Copy link
Author

(CI did not, in fact, go well)

Should be all fixed now, that failure seems to be an issue with nightly afaict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant