refactor: replace tokio::task::spawn_blocking with AsyncHandler::spawn_blocking for improved task management

This commit is contained in:
Tunglies
2025-08-22 03:52:30 +08:00
parent e4c243de2d
commit 6d112c387d
6 changed files with 28 additions and 12 deletions

View File

@@ -11,4 +11,12 @@ impl AsyncHandler {
{
async_runtime::spawn(f())
}
pub fn spawn_blocking<T, F>(f: F) -> JoinHandle<T>
where
F: FnOnce() -> T + Send + 'static,
T: Send + 'static,
{
async_runtime::spawn_blocking(f)
}
}