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
| Need | Use |
|---|---|
| Logs, metrics, alerts, or diagnostics | Subscribe events |
| Final outcome for watched work | TaskWaiter |
| Result of a management command | The 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:
AttemptFailedandAttemptTimedOutdescribe one attempt. A later attempt may still run.TaskFinishedcarries the final outcome class. Registry cleanup then attemptsTaskRemoved.- Cancellation between attempts can reach
TaskFinished(Canceled)without anAttemptCanceledevent. Event::seqrecords process-local construction order. It is not a causal clock, and gaps are expected when events are dropped.Event::reasonis diagnostic text. Use typed enums and their stableas_labelmethods for machine decisions and telemetry.- Rejected work never enters the registry. It has no
TaskFinishedorTaskRemovedevent.
Structs§
- Event
- One best-effort runtime event with optional typed metadata.
Enums§
- Backoff
Source - Identifies why a
BackoffScheduleddelay exists. - Event
Kind - Classifies one best-effort runtime event.
- Rejection
Kind - Classifies why submitted work was rejected before its task body ran.