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

with_tokio_rt closure requires to pass Runtime #580

Open
gz opened this issue Jul 2, 2024 · 0 comments
Open

with_tokio_rt closure requires to pass Runtime #580

gz opened this issue Jul 2, 2024 · 0 comments

Comments

@gz
Copy link

gz commented Jul 2, 2024

It would be nice if with_tokio_rt also works with closures that e.g., return Arc<Runtime> or similar.

e.g., my use-case is that my tokio runtime is declared as

pub static TOKIO: Lazy<Runtime> = Lazy::new(|| Runtime::new().unwrap());

to share it across the code and I'd like to be able to pass it to System::with_tokio_rt too, but Runtime doesn't implement Copy.

@gz gz changed the title with_tokio_rt closure requires runtime Runtime with_tokio_rt closure requires to pass Runtime Jul 2, 2024
@robjtede robjtede transferred this issue from actix/actix-web Jul 4, 2024
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

No branches or pull requests

1 participant