Skip to main content

Module events

Module events 

Source
Expand description

Exposes Taskvisor’s best-effort lifecycle stream for observability.

The registry, task actors, controller, and shutdown workflow publish ordinary Event values to an internal bounded bus. The runtime relay forwards retained events to the bounded queue of each Subscribe implementation. Internal subscriber diagnostics can start at the relay or a subscriber lane and bypass the shared bus.

runtime components
       │ Event
       ▼
bounded Bus
       │ retained events
       ▼
event relay ──► subscriber queues ──► Subscribe callbacks

internal diagnostics ──► event relay or subscriber lane ──► callbacks

§Choosing the right result path

NeedUse
Logs, metrics, alerts, or diagnosticsSubscribe events
Final outcome for watched workTaskWaiter
Result of a management commandThe management method’s returned result

The stream is observational, not a reliable confirmation channel. Bus overflow and subscriber queue pressure can drop events. Missing an event does not mean the action did not happen, and runtime state never depends on delivery.

EventKind identifies what happened. Event carries its metadata. TaskOutcomeKind, BackoffSource, and RejectionKind provide typed details for outcomes, backoff, and rejection events. Implement Subscribe for custom handling, or use the feature-gated LogWriter and TracingBridge subscribers for ready-made output.

Important stream rules:

  • AttemptFailed and AttemptTimedOut describe one attempt. A later attempt may still run.
  • TaskFinished carries the final outcome class. Registry cleanup then attempts TaskRemoved.
  • Cancellation between attempts can reach TaskFinished(Canceled) without an AttemptCanceled event.
  • Event::seq records process-local construction order. It is not a causal clock, and gaps are expected when events are dropped.
  • Event::reason is diagnostic text. Use typed enums and their stable as_label methods for machine decisions and telemetry.
  • Rejected work never enters the registry. It has no TaskFinished or TaskRemoved event.

Structs§

Event
One best-effort runtime event with optional typed metadata.

Enums§

BackoffSource
Identifies why a BackoffScheduled delay exists.
EventKind
Classifies one best-effort runtime event.
RejectionKind
Classifies why submitted work was rejected before its task body ran.