Expand description
Spawning tokio tasks and OS threads through handles that own them.
spawn and spawn_on start a tokio task and return a TaskHandle,
which aborts the task when dropped. spawn_thread starts a named OS
thread and returns a ThreadHandle, which joins the thread when dropped.
Each spawn takes a name, and a panic in the task or thread is logged at
ERROR with that name. The panic still reaches a caller that awaits or
joins the handle.
Structs§
- Task
Handle - An owned tokio task, aborted when the handle drops.
- Thread
Handle - An owned OS thread, joined when the handle drops.
Functions§
- panic_
text - The text of a panic payload: the message of a
&strorStringpayload, and a fixed placeholder for any other type. - spawn
- Spawn
futureas a task namednameon the current tokio runtime. - spawn_
on - Spawn
futureas a task namednameon the runtime behindhandle. - spawn_
thread - Spawn
fon a new OS thread namedname.