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

refactor(s2n-quic-core): simplify clock and timer traits #1733

Merged
merged 1 commit into from
May 3, 2023

Conversation

camshaft
Copy link
Contributor

@camshaft camshaft commented Apr 28, 2023

Description of changes:

While implementing the AF_XDP IO provider, I wanted to make a generic event loop implementation so I didn't have to copy/paste the one from the tokio provider. Today, the clock to get the current time is generic. However, there's no trait for getting a timer from the clock and awaiting on its expiration.

In this change, the clock and timer traits are refactored to make it possible to use in the IO provider event loop. This is done by adding a ClockWithTimer trait that is used in the IO event loop.

Call-outs:

While I was changing the interface, I went through and removed all references to s2n-quic-platform in s2n-quic-transport with the testing module in s2n-quic-core. This simplifies the testing dependencies a bit and makes it so every crate can use the clock in a consistent way. The only last place that uses the time module is the default address token provider, and I've opened an issue to track that separately: #1738.

Testing:

Since this is just shuffling things around, the existing tests should cover the changes.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@camshaft camshaft force-pushed the camshaft/time-refactor branch 3 times, most recently from abc1f05 to 7d62cce Compare April 28, 2023 23:50
@camshaft camshaft marked this pull request as ready for review May 1, 2023 15:48
@camshaft camshaft force-pushed the camshaft/time-refactor branch from 7d62cce to f19e8f7 Compare May 2, 2023 18:00
@camshaft camshaft force-pushed the camshaft/time-refactor branch from f19e8f7 to 0a60a01 Compare May 2, 2023 23:40
@camshaft camshaft merged commit 222bc54 into main May 3, 2023
@camshaft camshaft deleted the camshaft/time-refactor branch May 3, 2023 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants