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 tokio02 feature flag #804

Merged
merged 2 commits into from
Jun 4, 2020
Merged

Add tokio02 feature flag #804

merged 2 commits into from
Jun 4, 2020

Conversation

yoshuawuyts
Copy link
Contributor

Adds the tokio02 feature flag. This forwards to smol's tokio02 feature flag which runs tokio::rt::enter whenever a new thread is created. This should allow running async_std::main and having tokio crates just work ™. Thanks!

@yoshuawuyts yoshuawuyts changed the title Add the tokio02 feature flag Add tokio02 feature flag Jun 3, 2020
@skade
Copy link
Collaborator

skade commented Jun 3, 2020

This transitively ties us to the currently internal runtime and requests it to have tokio support. I'm not super sure what would be a remedy for that, but we should make clear what the expectations from our side top expose such a feature are.

@yoshuawuyts
Copy link
Contributor Author

This transitively ties us to the currently internal runtime and requests it to have tokio support.

Adding this feature isn't too difficult even if we were to switch internal engines -- the way this works is calling tokio::rt::enter every time we call thread::spawn. This feature is really useful for projects currently using tokio but wanting to switch away from it. It enables switching over one dependency at the time rather than being forced into a "rewrite the world" scenario.


@skade could you maybe say more what you mean by: "[...] the expectations from our side top expose such a feature are."

@skade
Copy link
Collaborator

skade commented Jun 3, 2020

I was very tired, so sentence makes no sense.

What I wanted to say is that the feature should be specified from the top down instead of bottom up.

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.

3 participants