use actix_web::web; pub fn block_background(f: F) where F: FnOnce() -> Result + Send + 'static, I: Send + 'static, E: Send + std::fmt::Debug + 'static, { async fn inner(f: F) where F: FnOnce() -> Result + Send + 'static, I: Send + 'static, E: Send + std::fmt::Debug + 'static, { let _ = web::block(f).await; } actix::spawn(inner(f)); }