#[non_exhaustive]pub enum Response {
Show 26 variants
Pong,
Flock(Vec<ProcessInfo>),
Described(Vec<ProcessInfo>),
Started(Vec<ProcessInfo>),
Added(Vec<ProcessInfo>),
Drifted(Vec<SheepDrift>),
Applied(Vec<SheepApplied>),
Stopped(Vec<ProcessInfo>),
Restarted(Vec<ProcessInfo>),
Reloading(Vec<ProcessInfo>),
Scaled(Vec<ProcessInfo>),
SmitPainted(Vec<ProcessInfo>),
Deleted(Vec<u32>),
Reopened(Vec<ProcessInfo>),
Flushed(Vec<ProcessInfo>),
Triggered(Vec<ActionReply>),
Signalled(Vec<SignalReply>),
SentLine(Vec<LineReply>),
RollSaved {
path: String,
apps: u32,
},
Mustered(Vec<ProcessInfo>),
DogSection {
toml: DogSectionToml,
},
DogStarted(ProcessInfo),
DogStaleness {
stale: Vec<String>,
pending: Vec<String>,
},
HandoverFitness {
refusal: Option<String>,
},
Subscribed,
ShuttingDown,
}Expand description
One RPC response (pairs with Request variants)
Ten variants carry a bare Vec<ProcessInfo>. Do not collapse them into
one: each names which request it answers, which is what lets a variant
diverge without a protocol bump. Reloading already means an acceptance
rather than a result, Scaled only the survivors of a scale-down, and
Mustered every sheep of every restored app rather than what this call
started.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Pong
Answer to Ping
Flock(Vec<ProcessInfo>)
Answer to ListFlock
Described(Vec<ProcessInfo>)
Answer to Describe
Started(Vec<ProcessInfo>)
Answer to Start
Added(Vec<ProcessInfo>)
Answer to Add: one row per app the request named, registered and
spawning nothing.
A row here can still be Online: Add is idempotent by name, so the
reply describes the membership the request leaves behind.
Drifted(Vec<SheepDrift>)
Answer to ConfigDrift: one entry per app that is registered under a
config different from the one asked about, and no entry for anything
else. An empty vector means every app asked about either matches or
is not registered at all.
Applied(Vec<SheepApplied>)
Answer to ApplyConfig: one entry per app the request named, in the
order it named them, the refused and the unchanged included.
Complete where Self::Drifted is filtered: an app missing from
“what did you do to each of these” looks like one the daemon dropped.
Stopped(Vec<ProcessInfo>)
Answer to Stop
Restarted(Vec<ProcessInfo>)
Answer to Restart
Reloading(Vec<ProcessInfo>)
Answer to Reload: an acceptance, not a result.
One instance costs a readiness wait plus a drain, so a clustered app
outlasts any deadline a client may ask for. The daemon answers as soon
as the reload is accepted, with the matched sheep as they stood then,
and the swaps report themselves on the bus (process.reload,
process.reloaded, process.reload_abandoned). A matched sheep with
nothing to replace is listed as the no-op success it is.
Scaled(Vec<ProcessInfo>)
Answer to Scale: the app’s instances that will remain, one row each,
ordered by sort_flock. Every row shares one name, so that is slot
order with the id breaking a tie.
Scaling down, the departing instances are absent even though their
kill ladders are still running; they report themselves on the bus as
process.delete.
SmitPainted(Vec<ProcessInfo>)
Answer to SetSmit: every instance of the named sheep, one row each,
carrying the smit as it now stands.
Deleted(Vec<u32>)
Answer to Delete: ids removed
Reopened(Vec<ProcessInfo>)
Answer to Reopen: every matched sheep, running or not. A sheep with
no live log pump has nothing to reopen and is reported as a success,
so this carries the same matches Describe would.
Flushed(Vec<ProcessInfo>)
Answer to Flush: one row per matched sheep, running or not, exactly
as Self::Reopened.
One row per sheep, not per file emptied: several sheep can share one log path, and the daemon truncates each distinct path once.
Triggered(Vec<ActionReply>)
Answer to Trigger: one ActionReply row per matched sheep, rather
than a flock listing, since ProcessInfo has nowhere to hold a reply
body.
Signalled(Vec<SignalReply>)
Answer to Signal: one SignalReply row per matched sheep.
Not a flock listing: ProcessInfo has nowhere to hold a per-sheep
outcome.
SentLine(Vec<LineReply>)
Answer to SendLine: one LineReply row per matched sheep.
RollSaved
Answer to SaveRoll
Fields
Mustered(Vec<ProcessInfo>)
Answer to Muster: every sheep of every app the roll restored, not
only the ones this call spawned.
Assembling a flock that is already assembled starts nothing, so a listing of what this call spawned would be indistinguishable from an empty roll.
DogSection
Answer to DogConfig: the dog’s own section, rendered back to TOML.
toml is DogSectionToml, whose manual Debug keeps the webhook
credentials this text carries out of a {:?}-formatted Response.
Fields
toml: DogSectionTomlThe [dog.<name>] table as TOML text, empty when the file has
no such section
DogStarted(ProcessInfo)
Answer to EnableDog: the dog as it stands now
DogStaleness
Answer to DogStaleness: this daemon’s own handshake record, split
into the dogs it has given up on and the dogs it is still waiting on.
Two lists because they answer two questions. stale is a finding;
pending is a reason to ask again, since a reading taken now would
be a guess about them.
Names only: two builds differing only in the protocol they speak report the same crate version.
Fields
HandoverFitness
Answer to HandoverFitness: None when the whole flock can be
carried across a daemon handover, and otherwise the sentence saying
which sheep cannot be and why.
A rendered sentence rather than a structured reason: the set of things a handover cannot carry keeps changing, and the client only prints it.
Subscribed
Answer to Subscribe
ShuttingDown
Answer to KillDaemon