Expand description
A per-thread runtime wrapper for Tokio
A level runtime is a multi-thread Tokio configuration, but each thread is its own local runtime. It’s mostly for servers.
Use spawn_balanced() to spawn a task on any thread.
Load balancing the tasks across the runtimes is done via
best-of-two random choices.
Use spawn_local() to spawn a task on this thread, with
the concurrency tracking intact. Avoid tokio::spawn, as
that interferes with the load leveling heuristic.
Use spawn_on_each() to spawn multiple copies of a task,
one per worker thread.
Structs§
- Builder
- A setup builder for your level runtime.
- Level
Runtime - A wrapper for a collection of tokio current-thread runtimes.
- Level
Runtime Handle - A handle to a LevelRuntime for spawning tasks.
- Level
Worker - A thread-local runtime wrapper
- Level
Worker Handle - A spawn handle for the local runtime
Functions§
- spawn_
balanced - Spawn a task on one of the local runtimes, with a work balance heuristic.
- spawn_
local - Spawn this future on this local thread runtime.
- spawn_
on_ each - Spawn a copy of a task on each local runtime.