Skip to main content

HarnessOperatorEventV1

Enum HarnessOperatorEventV1 

Source
pub enum HarnessOperatorEventV1 {
    SnapshotBaseline {
        sequence: u64,
        tasks: Vec<RedactedTaskV1>,
        runs: Vec<RedactedRunV1>,
        nodes: Vec<HarnessRuntimeNodeInventoryV1>,
    },
    TaskChanged {
        sequence: u64,
        task: RedactedTaskV1,
    },
    RunChanged {
        sequence: u64,
        run: RedactedRunV1,
    },
    RuntimeInventoryChanged {
        sequence: u64,
        node: HarnessRuntimeNodeInventoryV1,
    },
    RuntimeInventoryRemoved {
        sequence: u64,
        node_id: String,
    },
    Lagged {
        sequence: u64,
    },
    Ping {
        sequence: u64,
    },
}
Expand description

Long-lived, server-push counterpart to HarnessOperatorReplyV1. A SubscribeEvents connection stops replying with a single frame and instead writes one of these, newline-terminated, per change – see the module doc for the framing this switches the connection into. sequence is a per-subscription monotonic counter the host mints for that one connection alone; it never resets, including across a Lagged/SnapshotBaseline pair, so a client can detect a gap without cross-referencing wall time. An auth failure or an over-limit subscribe never reaches this type at all – both still use the ordinary single-frame HarnessOperatorReplyV1::Error before the connection closes, since neither one ever admits a subscription in the first place.

Variants§

§

SnapshotBaseline

Always the first frame after a successful subscribe, and re-sent as the recovery frame immediately after a Lagged – the client must treat this as a full replacement of its task/run/node state, never a delta against whatever it held before.

§

TaskChanged

Fields

§sequence: u64
§

RunChanged

Fields

§sequence: u64
§

RuntimeInventoryChanged

§

RuntimeInventoryRemoved

Fields

§sequence: u64
§node_id: String
§

Lagged

This subscriber’s outbound queue overflowed and one or more events were dropped for it specifically – other subscribers are unaffected. The host always follows this with a fresh SnapshotBaseline once it can build one; until that frame arrives the client must treat every task/run/node it is holding as stale rather than trying to patch around the gap.

Fields

§sequence: u64
§

Ping

Server-side keep-alive, unconditional and periodic (see hatchery-harness-service::runtime’s own HOST_SUBSCRIBER_KEEPALIVE_INTERVAL): the registry’s only way to discover a dead subscriber is a write to it actually failing, so without something to push on an otherwise-idle connection an abandoned subscriber can sit occupying its slot indefinitely (see SubscriberRegistry’s own doc comment). Deliberately its own variant rather than reusing an existing one: Lagged carries a promise (a SnapshotBaseline follows) that a bare keep-alive would break, and every other variant carries real task/run/node state a client applies – faking either risks a client acting on a change that never happened. Ping carries nothing to act on, so it cannot be mistaken for either; every current reader (hatchery-harness-client’s generic next_event decode, hatchery-tui’s project_harness_operator_event) drops it on the floor by construction. sequence is kept only for schema symmetry with every other variant – there is no gap to detect against a keep-alive that carries no state of its own.

Fields

§sequence: u64

Implementations§

Trait Implementations§

Source§

impl Clone for HarnessOperatorEventV1

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for HarnessOperatorEventV1

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for HarnessOperatorEventV1

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for HarnessOperatorEventV1

Source§

impl PartialEq for HarnessOperatorEventV1

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for HarnessOperatorEventV1

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for HarnessOperatorEventV1

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.