mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-07 09:57:47 +08:00
13 lines
320 B
Rust
13 lines
320 B
Rust
use std::future::Future;
|
|||
|
|
|
||
|
|
pub fn spawn_named<F>(task_name: &'static str, future: F) -> tokio::task::JoinHandle<F::Output>
|
||
|
|
where
|
||
|
|
F: Future + Send + 'static,
|
||
|
|
F::Output: Send + 'static,
|
||
|
|
{
|
||
|
|
tokio::spawn(async move {
|
||
|
|
tracing::debug!(task = task_name, "spawned runtime task");
|
||
|
|
future.await
|
||
|
|
})
|
||
|
|
}
|