1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-07-01 16:55:08 +02:00

remove actix-threadpool.use actix_rt::task::spawn_blocking (#1878)

This commit is contained in:
fakeshadow
2021-01-10 00:04:19 +08:00
committed by GitHub
parent f6cc829758
commit fe392abeb4
16 changed files with 83 additions and 71 deletions

View File

@ -280,5 +280,8 @@ where
I: Send + 'static,
E: Send + std::fmt::Debug + 'static,
{
actix_threadpool::run(f).await
match actix_rt::task::spawn_blocking(f).await {
Ok(res) => res.map_err(BlockingError::Error),
Err(_) => Err(BlockingError::Canceled),
}
}