pub enum Message {
Show 14 variants
RegisterTriggerType {
id: String,
description: String,
trigger_request_format: Option<Value>,
call_request_format: Option<Value>,
namespace: Option<String>,
},
RegisterTrigger {
id: String,
trigger_type: String,
function_id: String,
config: Value,
metadata: Option<Value>,
namespace: Option<String>,
trigger_namespace: Option<String>,
},
TriggerRegistrationResult {
id: String,
trigger_type: String,
function_id: String,
error: Option<ErrorBody>,
},
UnregisterTrigger {
id: String,
trigger_type: String,
},
UnregisterTriggerType {
id: String,
},
RegisterFunction {
id: String,
description: Option<String>,
request_format: Option<Value>,
response_format: Option<Value>,
metadata: Option<Value>,
invocation: Option<HttpInvocationConfig>,
},
UnregisterFunction {
id: String,
},
InvokeFunction {
invocation_id: Option<Uuid>,
function_id: String,
data: Value,
traceparent: Option<String>,
baggage: Option<String>,
action: Option<TriggerAction>,
metadata: Option<Value>,
namespace: Option<String>,
},
InvocationResult {
invocation_id: Uuid,
function_id: String,
result: Option<Value>,
error: Option<ErrorBody>,
traceparent: Option<String>,
baggage: Option<String>,
},
Ping,
Pong,
Reattach {
previous_worker_id: String,
reattach_token: Option<String>,
},
WorkerRegistered {
worker_id: String,
reattach_token: Option<String>,
},
RegistrationRejected {
code: String,
namespace: String,
worker_name: Option<String>,
function_id: Option<String>,
owner_worker_id: String,
},
}Variants§
RegisterTriggerType
Fields
RegisterTrigger
Fields
namespace: Option<String>Namespace the trigger’s target function resolves in.
The engine reads an absent field as its default namespace. The SDK
does not leave it absent: register_trigger fills it from this
worker’s namespace, because the function a trigger names is one this
worker registered, and that landed in the worker’s namespace. Name
another namespace, default included, to bind elsewhere.
TriggerRegistrationResult
UnregisterTrigger
UnregisterTriggerType
RegisterFunction
Fields
invocation: Option<HttpInvocationConfig>UnregisterFunction
InvokeFunction
Fields
action: Option<TriggerAction>metadata: Option<Value>Per-invocation metadata sidecar, surfaced to the handler as a
distinct argument alongside data. Optional and additive
for wire compatibility with engines that don’t send it.
namespace: Option<String>Target namespace for routing. Optional and additive, so older peers that don’t send it stay wire-compatible, and the engine reads an absent field as its default namespace.
A call made through this SDK does not arrive absent: trigger fills
it from this worker’s namespace unless the request names one.
InvocationResult
Fields
Ping
Pong
Reattach
Sent to the engine as the first message of a reconnect, before the
registration replay: previous_worker_id and reattach_token are
the values the engine assigned via WorkerRegistered on the previous
connection. The engine retires that connection so the replay lands on
a clean slate; the token is required because worker ids alone are
publicly discoverable.
WorkerRegistered
Fields
RegistrationRejected
Pushed by the engine when a registration collides with a live worker in
the same namespace. The code distinguishes the two cases:
WORKER_NAMESPACE_CONFLICT is fatal (the engine closes the connection;
the SDK stops and does not reconnect), while FUNCTION_NAMESPACE_CONFLICT
refuses a single function id and keeps the connection open.