Add support for tokio as well as async-std via feature flags (incomplete) #14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello!
Addressing #13 I started work on adding feature flags for each runtime and fixing the various issues that cropped up (many!). I haven't finished the work but I'd like to share what I've done incase somebody else has time to pick up the remaining work needed here, as I am short on time at the moment!
So far, I've added a
runtime-async-std
andruntime-tokio
feature flag.Runs without any issues.
Has a few errors remaining that need fixing (primarily around AsyncRead/AsyncWrite traits IIRC).
I've tried to keep all differences contained within
runtime.rs
, though there is one place where I use a#[cfg(feature="runtime-tokio")]
outside that file at the moment. It would be nice if possible (IMO) to keep all differences contained withinruntime.rs
. I also haven't tweaked or added any specific tests for this (butcargo test
still works fine with the async-std runtime).A breaking change I've made is to require selection of the runtime feature; it would be pretty easy to default to async-std though if preferred (this prob breaks the CI stuff that I haven't looked at).
Anyway; please reply if you have an interest on pushing this over the finish line :)