-
-
Notifications
You must be signed in to change notification settings - Fork 410
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
Make SystemTime mockable via object #2089
Conversation
e69f6f8
to
5f4961b
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.
@aochagavia given that you've used Quinn in simulated time environments, any feedback on this?
@djc I haven't needed something like this at all, since as far as I know quinn fully supports mocking time through tokio. In fact, tokio's time mocking features are incredibly powerful, allowing you to automatically time-warp to the next event if the runtime isn't blocked on any other operation. I'd advice anyone needing clock mocking to look into Update: I see now that this is about |
Yeah, I believe proto already doesn't have any occurrences of |
- Adds trait TimeSource - Adds default implementation StdSystemTime - Adds ServerConfigParameter time_source: Arc<dyn TimeSource> - Replaces all SystemTime::now calls in proto with TimeSource.now calls (there were 2) This is a backwards-compatible change.
5f4961b
to
cd947db
Compare
Thanks! |
This is a backwards-compatible change.