Module std.concurrency.lifecycle

Generic lifecycle state machine for resource-owning services.

Contents

Types

Enum LifecycleError

Why a lifecycle-managed service faulted.

Variants

StartFailed(string)

Initialisation failed before the service started.

Crashed(string)

The running service crashed.

Machines

Machine Lifecycle

pub machine Lifecycle<T>

States

Created
Initialising
Running { handle: T }
Stopping
Stopped
Faulted { error: LifecycleError }

Events

Initialise
Started { handle: T }
Stop
Crashed { error: LifecycleError }

See the machine reference for generated step, report, output, and state-name APIs.