-
Notifications
You must be signed in to change notification settings - Fork 111
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 a timeout to the PeerServer
event loop.
#65
Conversation
This closes #51 but the main event loop for the |
c7ec58a
to
592b1e8
Compare
Going to try cleaning up the event loop a bit. |
e34c818
to
acb8848
Compare
Cleaned the event loop, removed the only other use of the |
I think this code could be cleaned up significantly (e.g., removing the other use of select!) but that's potentially a larger change than this PR.
00f6c73
to
e7f87d4
Compare
Rebased on top of |
Ok(new_state) => self.state = new_state, | ||
Ok(new_state) => { | ||
self.state = new_state; | ||
self.request_timer = Some(delay_for(constants::REQUEST_TIMEOUT)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
None => return, | ||
} | ||
} | ||
match future::select(shutdown_rx.next(), worker_rx.next()).await { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Those renamings were incomplete, so I'm going to edit them locally, check they wrok, and update the branch |
Co-Authored-By: Henry de Valence <[email protected]>
956fbdf
to
350d292
Compare
amended & updated! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ✨
I think this code could be cleaned up significantly (e.g., removing the
other use of select!) but that's potentially a larger change than this
PR.