-
Notifications
You must be signed in to change notification settings - Fork 8
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
update to tokio 1.0 #9
Conversation
Codecov Report
@@ Coverage Diff @@
## master #9 +/- ##
=======================================
Coverage 81.21% 81.21%
=======================================
Files 3 3
Lines 165 165
=======================================
Hits 134 134
Misses 31 31
Continue to review full report at Codecov.
|
Hmm, I suppose since we're just using As for the tests, I'd prefer to keep them on the same version nonetheless. Can we leverage |
Good point that although tokio does not show up in the external API, compatibility with older tokio versions is not necessarily guaranteed. I hadn't considered that and thus perhaps this should be investigated more closely before declaring that this does not require a semver bump. (My back-compat testing was limited to the tests in the crate.) (For reference, my motivation for this PR was simply eliminating tokio 0.3 from my dependency tree and replacing it exclusively with tokio 1.0.) Regarding keeping the tests using the same version of tokio as the implementation and the Stream trait issue: I agree it is a nice goal and I originally tried to do that. However, I realized that it will substantially complicate the tests to port them to tokio 1.0 while tokio 1.0 is missing streams. As far as I remember (I forget the details already), using tokio-stream will still require a lot of boilerplate for what should be a simple example. In the end I see two possibilities that seem OK: The first is to keep the examples using tokio 0.3 until the Stream definition is in std at which point tokio will also implement this. Unfortunately this will take some months. The second possibility is to demonstrate and test stream-cancel not on tokio streams but e.g. simple self-defined ones. |
@astraw I think that should be helped by tokio-rs/tokio#3343, which adds back all the various |
Yes, those are the boilerplate implementations that I thought didn't belong in the stream-cancel examples. I think the stream-cancel examples/tests could be updated once those tokio-stream changes are published. Until then, in this pull request, I would be happy to rename tokio 0.3 to How do you like that idea? (Once Stream lands in std, a new version of |
Actually my proposal resulted in fewer changes than I anticipated, so I went ahead and updated this pull request. |
I think the |
Yes, now I updated the tests and examples to use the tokio-stream wrappers introduced in 0.1.1. |
Beautiful, thank you! Will release shortly. |
Released as |
This updates the internal use of tokio to 1.0. As I note in the module-level docstring, the examples (and tests) are kept using tokio 0.3 because tokio itself has removed the Stream trait until it is added in std.
I don't think this is a breaking change because tokio is not part of the API. Thus, I believe this could be released as non-breaking semver version bump.