actix-net icon indicating copy to clipboard operation
actix-net copied to clipboard

with_tokio_rt closure requires to pass `Runtime`

Open gz opened this issue 7 months ago • 0 comments

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 avatar Jul 02 '24 20:07 gz