refactor: IT RUNS!

Signed-off-by: Schmarni <marnistromer@gmail.com>
This commit is contained in:
Schmarni
2024-12-16 21:26:48 +01:00
parent 4e706f6c55
commit e3321c54fb
9 changed files with 84 additions and 52 deletions

View File

@@ -2,6 +2,8 @@ use color_eyre::eyre::Result;
use std::future::Future;
use tokio::task::JoinHandle;
use crate::TOKIO;
#[allow(unused_variables)]
pub fn new<
F: FnOnce() -> S,
@@ -13,7 +15,7 @@ pub fn new<
async_future: A,
) -> Result<JoinHandle<O>> {
#[cfg(not(feature = "profile_tokio"))]
let result = Ok(tokio::task::spawn(async_future));
let result = Ok(TOKIO.spawn(async_future));
#[cfg(feature = "profile_tokio")]
let result = tokio::task::Builder::new()
.name(name_fn().as_ref())