Skip to main content

Module shell

Module shell 

Source
Expand description

The shell traits: the only way the runtime spawns work, reads time or waits.

The core (vertep-core) reads no clock and spawns nothing. The runtime shell does both, but only through Spawn, Clock and Sleep, so that the same runtime runs on tokio (Shell::tokio), on a deterministic virtual clock in tests (Shell::virtual_time) and, later, in the browser.

Structs§

Shell
The three shell services a runtime node uses.
SystemClock
The system wall clock.
TokioSleep
Sleeps with tokio::time::sleep until a time of the given clock.
TokioSpawn
Spawns on the current tokio runtime.
VirtualClock
A clock that moves only when VirtualClock::advance or VirtualClock::set is called, and wakes the sleepers whose time has come. Cloning shares the clock.

Traits§

Clock
The time source of the shell. Only the shell reads it: a macrostep sees the time stamped on its input when the input was dequeued, which is journaled.
Sleep
Waits until a point in time of the shell’s Clock.
Spawn
Runs a future to completion in the background.

Type Aliases§

BoxFuture
A boxed, sendable future.