1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! # Runtime events.
//!
//! This module contains the event data model used by taskvisor.
//!
//! Events describe task lifecycle, runtime management, shutdown, subscriber diagnostics, and optional controller activity.
//!
//! | Type | Role |
//! |-------------------|--------------------------------------------|
//! | [`EventKind`] | Event classification |
//! | [`Event`] | Event payload and metadata |
//! | [`BackoffSource`] | Why a `BackoffScheduled` event was emitted |
//!
//! Events are delivered through an internal broadcast bus.
//! Delivery is best-effort: slow consumers may miss events.
//! Use events for observability, not as the only source of correctness.
//!
//! ## Common Flow
//!
//! ```text
//! Add:
//! TaskAddRequested ──► TaskAdded ──► TaskStarting
//! └──► TaskAddFailed
//!
//! Attempt:
//! TaskStarting ──► TaskStopped
//! ├──► TaskCanceled
//! ├──► TaskFailed
//! └──► TimeoutHit ──► TaskFailed
//!
//! After success:
//! TaskStopped ──► ActorExhausted
//! └──► BackoffScheduled(Success) ──► TaskStarting
//!
//! After retryable failure:
//! TaskFailed ──► BackoffScheduled(Failure) ──► TaskStarting
//! └──► ActorExhausted
//!
//! After fatal failure:
//! TaskFailed ──► ActorDead
//!
//! Remove:
//! TaskRemoveRequested ──► TaskRemoved
//!
//! Shutdown:
//! ShutdownRequested ──► AllStoppedWithinGrace | GraceExceeded
//! ```
//!
//! [`TaskRemoved`](EventKind::TaskRemoved) is a registry cleanup confirmation.
//! It is emitted after the task actor has been joined or cleaned up.
//!
//! ## Subscribers
//!
//! User code consumes events by implementing [`Subscribe`](crate::Subscribe).
//! With the `logging` feature, `LogWriter` provides a small built-in example.
pub use REASON_MAX_RETRIES_EXCEEDED;
pub use ;
pub use Bus;