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

Sendless futures #1372

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

hamiltop
Copy link

Per #723 it may be useful to have an environment without Send and Sync.

This was a bit of slog, but it wasn't actually that bad. The main things that were needed:

  1. use async_trait::async_trait(?Send)
  2. remove Send and Sync bounds almost everywhere.
  3. use LocalBoxFuture instead of BoxFuture
  4. use .boxed_local() instead of .boxed()
  5. use tokio::task::spawn_local() instead of tokio::spawn(). Also add some tokio::task::TaskSets where needed.
  6. Get rid of a pesky lazy static TEST_HARNESS.

Overall it was mostly straightforward. Everything compiles and all tests pass.

If someone can confirm this is actually useful I'm happy to take a second pass and try and make it configurable via a feature flag.

This is mostly a PoC. We'll want to get this all behind a feature flag
so multi-threaded environments can still require Send.
If this is usefull, I'll go back and try to make this configurable by a feature-flag
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.

None yet

1 participant