pub struct ComputerEvent {
pub sandbox_id: ComputerId,
pub action: String,
pub timestamp_ns: i64,
pub attributes: HashMap<String, String>,
pub sequence: u64,
}Expand description
A sandbox lifecycle event broadcast to subscribers.
Fields§
§sandbox_id: ComputerId§action: StringOne of the [action] constants.
timestamp_ns: i64Unix nanoseconds.
attributes: HashMap<String, String>Extra context (e.g. "exit_code" on "idle", "error" on "failed").
sequence: u64Monotonic sequence number, 1-based, global across all sandboxes of
one manager and stamped in the order subscribers receive events —
so a subscriber whose received sequences are not contiguous knows
it missed events (CORE-147). That gap test is conclusive only on
this unfiltered subscription: the stamp precedes any downstream
filtering, so a filtered view (the wire API’s per-sandbox or
per-kind subscription) sees legitimate gaps for events its filter
dropped. Not persisted: a new manager numbers from 1 again. 0
only on an event that never went through the bus (or, on the
wire, one from a daemon predating sequencing). The delivery
contract this makes checkable is on
ComputerManager::subscribe_events.
Implementations§
Source§impl ComputerEvent
impl ComputerEvent
pub fn new(sandbox_id: &str, action: &str) -> Self
pub fn with_attr(self, key: &str, value: &str) -> Self
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Whether this event marks the sandbox’s teardown — nothing can run in it afterwards. A new terminal action must be added here, or torn-down sandboxes silently stop purging their executions.