Skip to main content

RunnerMessage

Enum RunnerMessage 

Source
pub enum RunnerMessage {
Show 27 variants Hello { schedr_version: String, mode: RunnerMode, }, FileStarted { path: String, }, FileParsed { path: String, dags: Vec<Dag>, connections: Vec<ConnectionDef>, error: Option<ErrorSummary>, warnings: Vec<String>, }, ParseFinished, TaskImported, TaskSucceeded { output: Value, outcome: String, }, SecretGet { secret: SecretName, }, ScriptDeclaration { reference: String, }, ConnectionGet { name: String, }, ApiCall { method: String, path: String, body: Option<Value>, idempotency_key: Option<String>, }, HandleAdd { handle: CleanupHandle, }, TaskFailed { error: ErrorSummary, kind: Option<String>, }, LoopBlocked { watcher: Option<u64>, stack: String, }, TriggerEvent { key: String, data: Value, at: Option<Timestamp>, }, TriggerPoked { error: Option<String>, }, HostAlive { threads: u32, tied_threads: u32, thread_stops: u64, loop_lag_ms: u64, }, WatcherStuck, WatcherMessage { watcher: u64, message: Box<RunnerMessage>, }, WatcherLog { stream: OutputStream, text: String, }, WatcherCancelled, WatcherMoved, ForkServerReady, ForkServerDisabled { reason: String, threads: Vec<String>, }, Forked { id: u64, }, ForkFailed { id: u64, reason: String, }, ProcessStarted { pid: i32, }, ProcessExited { code: Option<i32>, signal: Option<i32>, core_dumped: bool, usage: Option<ProcessUsage>, },
}
Expand description

A message from the runner to the agent.

Variants§

§

Hello

The first message: who is speaking and what for.

Fields

§schedr_version: String

The installed schedr package version; it must equal the agent’s.

§mode: RunnerMode

The mode the runner was started in.

§

FileStarted

The runner starts importing a file (the agent times each file).

Fields

§path: String

The file’s path relative to the root.

§

FileParsed

A file was imported, or failed to import.

Fields

§path: String

The file’s path relative to the root.

§dags: Vec<Dag>

The DAGs it defines (none for a helper module).

§connections: Vec<ConnectionDef>

The connections it defines itself (not those of modules it imports).

§error: Option<ErrorSummary>

Why importing it failed, if it did; then dags is empty.

§warnings: Vec<String>

The Python warnings importing it raised (Category: message), e.g. a TypingHint.

§

ParseFinished

Every requested file was handled.

§

TaskImported

The task’s DAG file is imported and its arguments built; its function is called next (the agent times the start from it). Not sent when that fails.

§

TaskSucceeded

The task’s function returned; its output is encoded and within the size limit.

Fields

§output: Value

The output as stored JSON (tagged extra types).

§outcome: String

The outcome’s name: SUCCESS, an outcome union member’s class name, or an Outcome member’s name.

§

SecretGet

A running task reads a secret it didn’t get with the request: one under a declared prefix (task_ctx.secret(...)); the agent answers AgentMessage::Secret or AgentMessage::SecretFailed.

Fields

§secret: SecretName

Which secret.

§

ScriptDeclaration

A DAG file being parsed has a ScriptOperator (decision 293): the declaration it refers to, <root>:<path>#<name> or /abs/path/schedr.toml#<name>; the agent answers AgentMessage::ScriptDeclaration or AgentMessage::ScriptNotFound.

Fields

§reference: String

The reference as written.

§

ConnectionGet

A running task opens a connection it didn’t get with the request (with name():); the agent answers AgentMessage::Connection or AgentMessage::ConnectionFailed.

Fields

§name: String

The connection’s name.

§

ApiCall

A request to schedr’s REST API (schedr.api, M4.11h): the agent has the master run it as the task; it answers AgentMessage::ApiAnswer.

Fields

§method: String

GET, POST, …

§path: String

The path and its query, e.g. /api/v1/events?name=paid.

§body: Option<Value>

The body, JSON; None for none.

§idempotency_key: Option<String>

Its Idempotency-Key.

§

HandleAdd

A running task registers a cleanup handle (cleanup_handle(x)); the agent answers AgentMessage::HandleAdded or AgentMessage::HandleRefused.

Fields

§handle: CleanupHandle

The handle.

§

TaskFailed

The task failed: an exception, or an output that can’t be stored.

Fields

§error: ErrorSummary

What went wrong.

§kind: Option<String>

A failure schedr recognises, e.g. output_not_serializable; None for an exception from the task’s own code.

§

LoopBlocked

A watcher host’s event loop has been held past its limit: it can only be killed.

Fields

§watcher: Option<u64>

The watcher holding it; None if no watcher is to blame.

§stack: String

Where the loop’s thread is.

§

TriggerEvent

What a trigger found (inside a Self::WatcherMessage); it goes on when told AgentMessage::EventStored.

Fields

§key: String

Its key, unique in its DAG.

§data: Value

Its data, encoded as an output is.

§at: Option<Timestamp>

When it happened, if it said.

§

TriggerPoked

A poke trigger’s call ended; error is why it failed. Nothing answers it.

Fields

§error: Option<String>

Why the call failed.

§

HostAlive

A watcher host is there, its event loop held or not, and how it is doing.

Fields

§threads: u32

Its process’s threads.

§tied_threads: u32

Those a wait step is tied to: running its to_thread calls, or started by it.

§thread_stops: u64

to_thread calls it stopped so far, each of which may have left shared state half updated.

§loop_lag_ms: u64

How long its event loop last took to get to a call, in milliseconds.

§

WatcherStuck

A thread of this watcher didn’t stop in its grace time: its host ends after its result (inside a Self::WatcherMessage).

§

WatcherMessage

Of one watcher, in a watcher host: what a task’s runner would send.

Fields

§watcher: u64

The watcher’s ID.

§message: Box<RunnerMessage>

The message: never a watcher_message.

§

WatcherLog

What a watcher printed: its attempt’s log (inside a Self::WatcherMessage).

Fields

§stream: OutputStream

Which of its streams.

§text: String

The text.

§

WatcherCancelled

A watcher ended by its cancel (inside a Self::WatcherMessage).

§

WatcherMoved

A poke stopped between calls, as asked: its next one is on new code (decision 335).

§

ForkServerReady

The fork server preloaded its libraries and is single-threaded: it takes fork requests.

§

ForkServerDisabled

The fork server can’t be used: tasks fall back (to the bare fork server, then to spawn). It answers every later fork with fork_failed until the agent closes the channel (exiting with a request unread would reset the connection and could lose this message). Also the answer to a fork when a thread appeared since the check.

Fields

§reason: String

Why, e.g. a failing preload or a second thread.

§threads: Vec<String>

The names of the threads besides the main one (/proc/self/task/*/comm).

§

Forked

A fork request was carried out: the shim runs, and reports on the status socket.

Fields

§id: u64

The request’s ID.

§

ForkFailed

A fork request failed; the task falls back.

Fields

§id: u64

The request’s ID.

§reason: String

Why.

§

ProcessStarted

From the shim, on the status socket: the forked process runs in its own process group (its ID is the PID), so the agent may signal and watch the group.

Fields

§pid: i32

The process’s PID, which is also its process group’s ID.

§

ProcessExited

From the shim, on the status socket: the forked process ended. The shim reaps it when the agent closes its end, so the PID isn’t reused before.

Fields

§code: Option<i32>

The exit code, if it exited.

§signal: Option<i32>

The signal that ended it, if one did.

§core_dumped: bool

Whether it dumped core (ended by a signal).

§usage: Option<ProcessUsage>

What it used, with the children it reaped; None if the shim couldn’t read it.

Trait Implementations§

Source§

impl Clone for RunnerMessage

Source§

fn clone(&self) -> RunnerMessage

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 RunnerMessage

Source§

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

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

impl<'de> Deserialize<'de> for RunnerMessage

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 RunnerMessage

Source§

impl JsonSchema for RunnerMessage

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for RunnerMessage

Source§

fn eq(&self, other: &RunnerMessage) -> 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 RunnerMessage

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 RunnerMessage

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.