-
Notifications
You must be signed in to change notification settings - Fork 506
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
feat: Refine runtime trait #2641
feat: Refine runtime trait #2641
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2641 +/- ##
=======================================
- Coverage 79.3% 79.3% -0.1%
=======================================
Files 123 123
Lines 22670 22682 +12
=======================================
+ Hits 17986 17993 +7
- Misses 4684 4689 +5 ☔ View full report in Codecov by Sentry. |
This would be towards # 1 in #2643 |
bb37bbe
to
56b5903
Compare
de0d53a
to
9987869
Compare
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.
Thanks!
@martintmk https://github.com/hyperium/hyper/blob/master/src/rt/mod.rs is what Hyper has. Maybe we should also need just that? |
…me-trait
The also have a different trait definition for timers: It works for them because the timers are only necessary if one wants to do keep-alive for connections, so they are not bound to their runtime trait definition. |
Contributes to #2643
Changes
This PR cleans-up and simplifies the
Runtime
trait.Before:
After:
The main changes is the drop of the interval, which can be moved to an internal helper method.
Future Improvements:
This trait could even made to be agnostic to single-threaded and multi-threaded runtimes and be simplified to:
The trait requirements would have to be specified on the consuming side:
However, this requires the return type notation support which is not yet stable.
Merge requirement checklist
CHANGELOG.md
files updated for non-trivial, user-facing changes