aion/signal
Typed signal references plus receive/send wrappers.
Types
A typed reference to a named workflow signal.
payload is the statically-known payload type. The codec is carried with the
reference so receive and send can cross the type-erased engine boundary
without asking workflow authors to hand-encode values at call sites.
pub opaque type SignalRef(payload)
Values
pub fn codec(
reference: SignalRef(payload),
) -> codec.Codec(payload)
Return the payload codec carried by a signal reference.
pub fn name(reference: SignalRef(payload)) -> String
Return the signal name used by the engine signal router boundary.
pub fn new(
name: String,
payload_codec: codec.Codec(payload),
) -> SignalRef(payload)
Construct a typed signal reference.
pub fn receive(
reference: SignalRef(payload),
) -> Result(payload, error.ReceiveError)
Receive the next payload for a typed signal reference.
The actual selective-receive and replay behavior is owned by AT/AD. This SDK
wrapper binds to that router through aion/internal/ffi, then decodes the
recorded payload with the reference codec and returns decode failures as
typed data. The await is a yield point: pending workflow queries are
serviced by the query pump before the signal resolves.
pub fn send(
workflow_id: String,
reference: SignalRef(payload),
payload: payload,
) -> Result(Nil, error.EngineError)
Send a typed signal payload to a workflow through the in-engine/Gleam-client binding.
This helper encodes the payload with the SignalRef codec and calls AT’s
signal-delivery boundary through FFI. It is not an HTTP or network client;
network-facing clients are provided outside aion_flow.