refactor: replace tokio::task::spawn_blocking with AsyncHandler::spawn_blocking for improved task management
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user