pub enum Command {
Task {
activity: String,
schema_ref: Option<String>,
input: Value,
queue: Option<String>,
retry: Option<RetryPolicy>,
lease_ttl_ms: Option<u64>,
timeout_ms: Option<u64>,
id: Option<String>,
},
Timer {
fire_in_ms: Option<u64>,
fire_at_ms: Option<u64>,
id: Option<String>,
},
Spawn {
workflow: String,
input: Value,
id: Option<String>,
},
AwaitSignal {
name: String,
schema_ref: Option<String>,
timeout_ms: Option<u64>,
id: Option<String>,
},
Emit {
channel: String,
data: Value,
},
Complete {
output: Value,
},
ContinueAsNew {
input: Value,
},
}Expand description
What a reducer asks the kernel for. Seven commands, closed set (see docs/workflows.md).
id lets a reducer name a step explicitly (needed for fan-out bookkeeping);
otherwise the kernel derives <kind>#<n> from KernelState::step_no.
Variants§
Task
Dispatch an activity to a worker; opens a task step in scheduled.
Fields
retry: Option<RetryPolicy>Retry policy; the default policy when None.
Timer
Open a timer step that fires at an absolute or relative time.
Fields
fire_in_ms: Option<u64>Delay in milliseconds from the event’s ts_ms; ignored when fire_at_ms is set.
Spawn
Start a child run; opens a child step in scheduled.
Fields
AwaitSignal
Park on a named signal; opens a signal step in awaiting_signal.
Fields
Emit
Publish to a side channel. Never journaled, never replayed.
Complete
End the run as completed. Must be the last command of the reduction.
ContinueAsNew
End the run as continued and start a successor with input. Must be the last
command of the reduction.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Command
impl<'de> Deserialize<'de> for Command
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Command
impl JsonSchema for Command
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more