pub static TASK_ID: LocalKeyImmutable<TaskID>Expand description
Provides a unique identifier for the current task.
Each task is assigned a globally unique ID when created. This ID can be used for tracking, logging, and debugging purposes.
ยงExamples
use some_executor::task::{Task, Configuration, TASK_ID};
let task = Task::without_notifications(
"tracked-task".to_string(),
Configuration::default(),
async {
TASK_ID.with(|id| {
if let Some(task_id) = id {
println!("Task {} is running", task_id.to_u64());
}
});
},
);