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

Add support for tokio as well as async-std via feature flags (incomplete) #14

Closed
wants to merge 1 commit into from

Conversation

jsdw
Copy link

@jsdw jsdw commented Mar 7, 2020

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 and runtime-tokio feature flag.

cargo check --features runtime-async-std

Runs without any issues.

cargo check --features runtime-tokio

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 within runtime.rs. I also haven't tweaked or added any specific tests for this (but cargo 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 :)

@jsdw jsdw closed this Feb 21, 2022
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.

1 participant