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

Use the new tokio LocalRuntime in actix_rt #597

Open
Sytten opened this issue Sep 3, 2024 · 5 comments
Open

Use the new tokio LocalRuntime in actix_rt #597

Sytten opened this issue Sep 3, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@Sytten
Copy link

Sytten commented Sep 3, 2024

This is a tracking issue

Tokio is deprecating the LocalSet (tokio-rs/tokio#6741) in favour of a new LocalRuntime (tokio-rs/tokio#6739) which will avoid panics if a user mixes tokio::spawn with tokio::spawn_local/actix_rt::spawn. It should also improve performances.

Once this is released we should migrate to the new runtime.

@Noah-Kennedy
Copy link

This is also likely to improve your performance a bit.

@robjtede robjtede added the enhancement New feature or request label Sep 3, 2024
@robjtede
Copy link
Member

robjtede commented Sep 3, 2024

It's also possible that LocalRuntime will be easy enough to use that we can just make actix-rt optional altogether. In particular, if there's a #[tokio::main(flavor = "local")] or similar.

@Noah-Kennedy
Copy link

It's also possible that LocalRuntime will be easy enough to use that we can just make actix-rt optional altogether. In particular, if there's a #[tokio::main(flavor = "local")] or similar.

You should leave this in the LocalSet issue thread as well so folks know that the macros are something you care about.

@Sytten
Copy link
Author

Sytten commented Sep 3, 2024

We will still need the system and arbiter concepts so pretty sure we will keep the crate around for some time.

@robjtede
Copy link
Member

robjtede commented Sep 4, 2024

We'd only need them for actors. The crate can stay around but it would be removed from the dependency tree of actix-web in a major release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants