Skip to main content

spawn_task_with

Function spawn_task_with 

Source
pub fn spawn_task_with<F>(task: TaskInner, initialize: F) -> AxTaskRef
where F: FnOnce(&AxTaskRef),
Expand description

Initializes the given task before adding it to the run queue.

The initialize callback receives the stable task reference before the task becomes runnable. Use it to publish runtime-specific task metadata that the task must be able to observe on its first instruction. The callback must not wait for the new task to run because it has not been registered or queued.

ยงPanics

Panics if initialize panics.