Documentation
¶
Overview ¶
Package protocol owns Restate handler identities, raw JSON and propagation.
Index ¶
Constants ¶
const ( // RunHandler is the name of the workflow run handler. RunHandler = "Run" // SignalHandler is the name of the shared handler that resolves signals. SignalHandler = "Signal" // CancelHandler is the name of the shared handler that stops the local // attempt of a run. CancelHandler = "Cancel" // SignalPromise prefixes the durable promise of a signal. SignalPromise = "sig:" // RunningKey is the state key that is true while the Run handler runs. RunningKey = "running" // AlreadyCompleted is part of the message of the failure Restate gives // for a second resolve of a promise. AlreadyCompleted = "already completed" // InvocationTimeout is the inactivity and abort timeout of the Run // handler. It is generous so a long step is not aborted by the server // defaults; MaxDuration is enforced by the runtime, not by these. InvocationTimeout = 24 * time.Hour // SpawnSettle is the durable timer after a Spawn. SpawnSettle = time.Millisecond // MetadataHeader prefixes the headers that carry [workflow.StartOptions] // metadata. MetadataHeader = "arkoren-meta-" )
const CodeCanceled = 409
CodeCanceled is the Restate failure code of a canceled invocation.
const TraceHeader = "arkoren-trace-"
TraceHeader separates propagation fields from the user metadata namespace. Restate persists these invocation headers across retries and suspension.
Variables ¶
This section is empty.
Functions ¶
func FromFailure ¶
FromFailure decodes the retained terminal envelope without numeric coercion.
func TraceCarrier ¶
func TraceCarrier(ctx restatesdk.RunContext) map[string]string
TraceCarrier reads only the explicit start carrier, never attempt headers or arbitrary metadata. The result is owned by the caller and safe to forward.
Types ¶
type Payload ¶
type Payload []byte
Payload carries the facade bytes, which are always JSON, as a raw JSON value on the wire. Restate then sees plain application/json and a caller without the SDK can use the ingress.
func (Payload) MarshalJSON ¶
MarshalJSON returns the bytes as they are, or null when empty.
func (*Payload) UnmarshalJSON ¶
UnmarshalJSON keeps a copy of the raw value.
type SignalRequest ¶
type SignalRequest struct {
// Name selects the application signal promise within the addressed workflow.
// It is separate from the native Signal handler name used by the gateway.
Name string `json:"name"`
// Payload contains the opaque JSON value forwarded to application dispatch.
Payload Payload `json:"payload"`
// Force resolves the promise even when the run is not running yet, for
// example while it waits for its delay.
Force bool `json:"force,omitempty"`
}
SignalRequest is the input of the Signal handler.