Documentation
¶
Overview ¶
Package protocol carries Peen's private, session-bound worker protocol.
One worker talks to its controller over one Unix socket. It registers with the credential its controller issued, asks for the durable records it needs, submits every event and state transition, and receives accepted work and cancellation. The controller validates the session and generation on every frame, writes each record to SQLite before publishing it, and answers with the durable result.
The worker has no generic control API credential. It cannot read, write, or affect another session, because its socket is bound to one session and every frame is checked against the generation that registered on it.
Index ¶
- Variables
- func WorkflowInstanceID(sessionID, executionID uuid.UUID) string
- type Ack
- type AgentRunCancellationResult
- type BoolResult
- type CancelAgentRun
- type CancelResult
- type CheckpointRequest
- type ChildInputRequest
- type ChildOptionsRequest
- type ChildRequest
- type Code
- type Command
- type Conn
- type Connection
- type Controller
- type CreateOrResumeRequest
- type Error
- type Frame
- type Handler
- type HashRequest
- type Hello
- type HelloAck
- type InputRequest
- type Kind
- type LeaseInputRequest
- type LeaseRequest
- type Listener
- type ListenerOption
- type Method
- type NestedChildInputRequest
- type NestedChildRequest
- type OptionsRequest
- type RecordTurnWorkerRequest
- type Registrar
- type RunTurn
- type SessionRequest
- type SignalJob
- type SignalJobResult
- type SnapshotRequest
- type Store
- func (s *Store) AcceptChildExecutionMessage(ctx context.Context, sessionID, executionID uuid.UUID, ...) (*session.ExecutionInboxAcceptance, error)
- func (s *Store) AcceptExecutionMessage(ctx context.Context, executionID uuid.UUID, lease session.Lease, ...) (*session.ExecutionInboxAcceptance, error)
- func (s *Store) AcquireDeferredExecutionTurn(ctx context.Context, sessionID, inboxID uuid.UUID, ...) (*session.DeferredTurnAdmission, error)
- func (s *Store) AcquireTurn(ctx context.Context, sessionID uuid.UUID, input session.StartTurnInput) (session.Lease, error)
- func (s *Store) AgentRunHistory(ctx context.Context, sessionID uuid.UUID, agentRunID uuid.UUID) (*session.AgentRunHistoryResult, error)
- func (s *Store) AppendAgentRunEvent(ctx context.Context, sessionID uuid.UUID, agentRunID uuid.UUID, ...) (*models.AgentRunEvent, error)
- func (s *Store) AppendAgentRunMessages(ctx context.Context, sessionID uuid.UUID, agentRunID uuid.UUID, ...) ([]*models.AgentRunMessage, error)
- func (s *Store) AppendCheckpoint(ctx context.Context, lease session.Lease, messages []session.MessageInput, ...) error
- func (s *Store) AppendJobOutput(ctx context.Context, sessionID uuid.UUID, jobID uuid.UUID, ...) (*models.JobOutputLine, error)
- func (s *Store) BeginExecutionActivity(ctx context.Context, sessionID, executionID, generationID uuid.UUID, ...) (*session.ActivityClaim, error)
- func (s *Store) Cancel(ctx context.Context, sessionID uuid.UUID) (bool, error)
- func (s *Store) ClaimAgentRun(ctx context.Context, sessionID, runID uuid.UUID, ...) (*models.AgentRun, error)
- func (s *Store) CompleteExecutionActivity(ctx context.Context, sessionID uuid.UUID, lease session.ActivityLease, ...) (*models.ExecutionActivity, error)
- func (s *Store) CompletedHistory(ctx context.Context, sessionID uuid.UUID) (*session.History, error)
- func (s *Store) CreateAgentRun(ctx context.Context, sessionID uuid.UUID, input session.StartAgentRunInput) (*models.AgentRun, error)
- func (s *Store) CreateAgentRunCompaction(ctx context.Context, sessionID uuid.UUID, agentRunID uuid.UUID, ...) (*models.AgentRunCompaction, error)
- func (s *Store) CreateCompaction(ctx context.Context, sessionID uuid.UUID, input session.CompactionInput) (*models.Compaction, error)
- func (s *Store) CreateExecution(ctx context.Context, sessionID uuid.UUID, input session.CreateExecutionInput) (*models.Execution, error)
- func (s *Store) CreateJob(ctx context.Context, sessionID uuid.UUID, input session.CreateJobInput) (*models.Job, error)
- func (s *Store) CreateModelCall(ctx context.Context, sessionID uuid.UUID, modelRunID uuid.UUID, ...) (*models.ModelCall, error)
- func (s *Store) CreateModelRun(ctx context.Context, sessionID uuid.UUID, input session.CreateModelRunInput) (*models.ModelRun, error)
- func (s *Store) CreateOrResume(ctx context.Context, _ *uuid.UUID, options session.OpenSessionOptions) (*session.OpenSessionResult, error)
- func (s *Store) CreateSessionNotice(ctx context.Context, sessionID uuid.UUID, ...) (*models.SessionNotice, error)
- func (s *Store) CreateWorkerGeneration(_ context.Context, _ uuid.UUID, _ session.CreateWorkerGenerationInput) (*models.WorkerGeneration, error)
- func (s *Store) DeferExecutionMessage(ctx context.Context, executionID uuid.UUID, lease session.Lease, ...) (*session.ExecutionInboxAcceptance, error)
- func (s *Store) DeliverChildExecutionMessages(ctx context.Context, sessionID uuid.UUID, lease session.ActivityLease, ...) (*session.ExecutionInboxDelivery, error)
- func (s *Store) DeliverExecutionMessages(ctx context.Context, sessionID uuid.UUID, ...) (*session.ExecutionInboxDelivery, error)
- func (s *Store) DrainSessionNotices(ctx context.Context, sessionID uuid.UUID) ([]*models.SessionNotice, error)
- func (s *Store) FinalizeAgentRun(ctx context.Context, sessionID uuid.UUID, agentRunID uuid.UUID, ...) (*models.AgentRun, error)
- func (s *Store) FinalizeJob(ctx context.Context, sessionID uuid.UUID, jobID uuid.UUID, ...) (*models.Job, error)
- func (s *Store) FinalizeModelCall(ctx context.Context, sessionID uuid.UUID, modelRunID uuid.UUID, ...) (*models.ModelCall, error)
- func (s *Store) FinalizeModelRun(ctx context.Context, sessionID uuid.UUID, modelRunID uuid.UUID, ...) (*models.ModelRun, error)
- func (s *Store) FinalizeTurn(ctx context.Context, lease session.Lease, input session.FinalizeTurnInput) error
- func (s *Store) GenerationID() uuid.UUID
- func (s *Store) Get(ctx context.Context, sessionID uuid.UUID) (*models.Session, error)
- func (s *Store) GetAgentRun(ctx context.Context, sessionID uuid.UUID, agentRunID uuid.UUID) (*models.AgentRun, error)
- func (s *Store) GetAgentRunCompaction(ctx context.Context, sessionID uuid.UUID, agentRunID uuid.UUID, ...) (*models.AgentRunCompaction, error)
- func (s *Store) GetCompaction(ctx context.Context, sessionID uuid.UUID, compactionID uuid.UUID) (*models.Compaction, error)
- func (s *Store) GetContextSnapshot(ctx context.Context, sessionID uuid.UUID, hash string) (*models.ContextSnapshot, error)
- func (s *Store) GetDirectoryState(ctx context.Context, sessionID uuid.UUID) (*session.DirectoryState, error)
- func (s *Store) GetExecution(ctx context.Context, sessionID, executionID uuid.UUID) (*models.Execution, error)
- func (s *Store) GetExecutionActivity(ctx context.Context, sessionID, activityID uuid.UUID) (*models.ExecutionActivity, error)
- func (s *Store) GetExecutionMessageByRequest(ctx context.Context, sessionID, executionID, requestID uuid.UUID) (*models.ExecutionInboxMessage, error)
- func (s *Store) GetExecutionRootTurn(ctx context.Context, sessionID, executionID uuid.UUID) (*models.Turn, error)
- func (s *Store) GetExecutionTurnLease(ctx context.Context, sessionID, executionID uuid.UUID) (*models.ExecutionTurnLease, error)
- func (s *Store) GetJob(ctx context.Context, sessionID uuid.UUID, jobID uuid.UUID) (*models.Job, error)
- func (s *Store) GetPromptSnapshot(ctx context.Context, sessionID uuid.UUID, hash string) (*models.PromptSnapshot, error)
- func (s *Store) InterruptExecutionActivity(ctx context.Context, sessionID uuid.UUID, lease session.ActivityLease) error
- func (s *Store) IsActive(sessionID uuid.UUID) bool
- func (s *Store) LatestAgentRunCompaction(ctx context.Context, sessionID uuid.UUID, agentRunID uuid.UUID) (*models.AgentRunCompaction, error)
- func (s *Store) LatestCompaction(ctx context.Context, sessionID uuid.UUID) (*models.Compaction, error)
- func (s *Store) ListAgentRunCompactions(ctx context.Context, sessionID uuid.UUID, agentRunID uuid.UUID, ...) (*session.AgentRunCompactionPage, error)
- func (s *Store) ListAgentRunEvents(ctx context.Context, sessionID uuid.UUID, agentRunID uuid.UUID, ...) (*session.AgentRunEventPage, error)
- func (s *Store) ListAgentRunMessages(ctx context.Context, sessionID uuid.UUID, agentRunID uuid.UUID, ...) (*session.AgentRunMessagePage, error)
- func (s *Store) ListAgentRuns(ctx context.Context, sessionID uuid.UUID, options session.ListAgentRunsOptions) (*session.AgentRunPage, error)
- func (s *Store) ListCompactions(ctx context.Context, sessionID uuid.UUID, ...) (*session.CompactionPage, error)
- func (s *Store) ListDeferredExecutionMessages(ctx context.Context, sessionID uuid.UUID, options session.ListEventsOptions) (*session.ExecutionInboxPage, error)
- func (s *Store) ListEvents(ctx context.Context, sessionID uuid.UUID, options session.ListEventsOptions) (*session.EventPage, error)
- func (s *Store) ListExecutionActivities(ctx context.Context, sessionID, executionID uuid.UUID, ...) (*session.ExecutionActivityPage, error)
- func (s *Store) ListExecutionEvents(ctx context.Context, sessionID, executionID uuid.UUID, ...) (*session.ExecutionEventPage, error)
- func (s *Store) ListExecutionMessages(ctx context.Context, sessionID, executionID uuid.UUID, ...) (*session.ExecutionInboxPage, error)
- func (s *Store) ListJobOutput(ctx context.Context, sessionID uuid.UUID, jobID uuid.UUID, ...) (*session.JobOutputPage, error)
- func (s *Store) ListJobSignalRequests(ctx context.Context, sessionID uuid.UUID, jobID uuid.UUID, ...) (*session.JobSignalRequestPage, error)
- func (s *Store) ListJobs(ctx context.Context, sessionID uuid.UUID, options session.ListJobsOptions) (*session.JobPage, error)
- func (s *Store) ListMessages(ctx context.Context, sessionID uuid.UUID, options session.ListMessagesOptions) (*session.MessagePage, error)
- func (s *Store) ListModelCalls(ctx context.Context, sessionID uuid.UUID, modelRunID uuid.UUID, ...) (*session.ModelCallPage, error)
- func (s *Store) ListModelRuns(ctx context.Context, sessionID uuid.UUID, options session.ListModelRunsOptions) (*session.ModelRunPage, error)
- func (s *Store) ListSessionNotices(ctx context.Context, sessionID uuid.UUID, ...) (*session.NoticePage, error)
- func (s *Store) ListTurns(ctx context.Context, sessionID uuid.UUID, options session.ListTurnsOptions) (*session.TurnPage, error)
- func (s *Store) OpenAgentRunQuestions(ctx context.Context, sessionID uuid.UUID) (map[uuid.UUID]string, error)
- func (s *Store) OpenWorkspace(_ context.Context, _ string, _ session.OpenSessionOptions) (*session.OpenSessionResult, error)
- func (s *Store) PauseExecution(ctx context.Context, sessionID, executionID uuid.UUID, reason string) ([]uuid.UUID, error)
- func (s *Store) PrepareAgentRunRecovery(ctx context.Context, sessionID, generationID uuid.UUID) (int, error)
- func (s *Store) RecordJobSignal(ctx context.Context, sessionID uuid.UUID, jobID uuid.UUID, ...) (*models.JobSignalRequest, error)
- func (s *Store) RecordModelCallRetries(ctx context.Context, sessionID uuid.UUID, modelRunID uuid.UUID, ...) error
- func (s *Store) RecordTurnWorkerGeneration(ctx context.Context, lease session.Lease, generationID uuid.UUID) error
- func (s *Store) RecoverInterrupted(_ context.Context) (int, error)
- func (s *Store) RecoverInterruptedAgentRuns(_ context.Context) (int, error)
- func (s *Store) RecoverInterruptedJobs(_ context.Context) (int, error)
- func (s *Store) RecoverInterruptedModelRuns(_ context.Context) (int, error)
- func (s *Store) RegisterCancellation(lease session.Lease, cancel context.CancelFunc)
- func (s *Store) ReleaseTurn(lease session.Lease)
- func (s *Store) RequestAgentRunCancellation(ctx context.Context, sessionID uuid.UUID, agentRunID uuid.UUID) (*models.AgentRun, bool, error)
- func (s *Store) RequestLocalCancellation(sessionID uuid.UUID) bool
- func (s *Store) ReserveExecutionCompletion(ctx context.Context, sessionID uuid.UUID, lease session.ActivityLease) (*session.ExecutionCompletionSeal, error)
- func (s *Store) ResolveExecutionActivity(ctx context.Context, sessionID, activityID uuid.UUID, ...) (*models.ExecutionActivity, error)
- func (s *Store) ResolveExecutionActivityFromActivity(ctx context.Context, sessionID, activityID uuid.UUID, ...) (*models.ExecutionActivity, error)
- func (s *Store) RestoreExecutionTurn(ctx context.Context, sessionID, executionID uuid.UUID, ...) (session.Lease, error)
- func (s *Store) ResumeExecution(ctx context.Context, sessionID, executionID uuid.UUID) ([]uuid.UUID, error)
- func (s *Store) ResumeExecutionFromActivity(ctx context.Context, sessionID, executionID uuid.UUID, ...) ([]uuid.UUID, error)
- func (s *Store) SaveContextSnapshot(ctx context.Context, snapshot *models.ContextSnapshot) error
- func (s *Store) SavePromptSnapshot(ctx context.Context, snapshot *models.PromptSnapshot) error
- func (s *Store) SearchExecutions(ctx context.Context, sessionID uuid.UUID, ...) (*session.ExecutionPage, error)
- func (s *Store) UpdateWorkerGenerationState(_ context.Context, _ uuid.UUID, _ string, _ string) error
- type TurnOrigin
- type TurnResult
- type Worker
- func (w *Worker) Cancel(ctx context.Context) (bool, error)
- func (w *Worker) CancelAgentRun(ctx context.Context, agentRunID uuid.UUID) (bool, error)
- func (w *Worker) Disconnect()
- func (w *Worker) Done() <-chan struct{}
- func (w *Worker) RunTurn(ctx context.Context, request RunTurn) (TurnResult, error)
- func (w *Worker) Shutdown(ctx context.Context) error
- func (w *Worker) SignalJob(ctx context.Context, jobID uuid.UUID, signal string) (SignalJobResult, error)
- type WorkflowBackend
- func (b *WorkflowBackend) CancelWorkflowInstance(ctx context.Context, instance *workflow.Instance, event *history.Event) error
- func (b *WorkflowBackend) Close() error
- func (b *WorkflowBackend) CompleteActivityTask(ctx context.Context, task *backend.ActivityTask, result *history.Event) error
- func (b *WorkflowBackend) CompleteWorkflowTask(ctx context.Context, task *backend.WorkflowTask, ...) error
- func (b *WorkflowBackend) CreateWorkflowInstance(ctx context.Context, instance *workflow.Instance, event *history.Event) error
- func (b *WorkflowBackend) ExtendActivityTask(ctx context.Context, task *backend.ActivityTask) error
- func (b *WorkflowBackend) ExtendWorkflowTask(ctx context.Context, task *backend.WorkflowTask) error
- func (b *WorkflowBackend) FeatureSupported(_ backend.Feature) bool
- func (b *WorkflowBackend) GetActivityTask(ctx context.Context, queues []workflow.Queue) (*backend.ActivityTask, error)
- func (b *WorkflowBackend) GetStats(_ context.Context) (*backend.Stats, error)
- func (b *WorkflowBackend) GetWorkflowInstanceHistory(ctx context.Context, instance *workflow.Instance, lastSequenceID *int64) ([]*history.Event, error)
- func (b *WorkflowBackend) GetWorkflowInstanceState(ctx context.Context, instance *workflow.Instance) (core.WorkflowInstanceState, error)
- func (b *WorkflowBackend) GetWorkflowTask(ctx context.Context, queues []workflow.Queue) (*backend.WorkflowTask, error)
- func (b *WorkflowBackend) Metrics() metrics.Client
- func (b *WorkflowBackend) Options() *backend.Options
- func (b *WorkflowBackend) PrepareActivityQueues(ctx context.Context, queues []workflow.Queue) error
- func (b *WorkflowBackend) PrepareWorkflowQueues(ctx context.Context, queues []workflow.Queue) error
- func (b *WorkflowBackend) RemoveWorkflowInstance(_ context.Context, _ *workflow.Instance) error
- func (b *WorkflowBackend) RemoveWorkflowInstances(_ context.Context, _ ...backend.RemovalOption) error
- func (b *WorkflowBackend) SignalWorkflow(ctx context.Context, instanceID string, event *history.Event) error
- func (b *WorkflowBackend) Tracer() trace.Tracer
Constants ¶
This section is empty.
Variables ¶
var ErrWorkerRejected = errors.New("worker registration rejected")
ErrWorkerRejected reports a registration the controller refused. A worker that sees it must exit rather than retry: the credential, session, or generation it was launched with is not one the controller will accept.
Functions ¶
func WorkflowInstanceID ¶ added in v0.25.0
WorkflowInstanceID scopes an execution's stable identity to its session.
Types ¶
type Ack ¶
type Ack struct{}
Ack answers an operation that succeeded and carries no value.
It exists so a successful write is a real result rather than a nil pair, which would read the same as a handler that forgot to answer.
type AgentRunCancellationResult ¶
type AgentRunCancellationResult struct {
Run *models.AgentRun `json:"run"`
Requested bool `json:"requested"`
}
AgentRunCancellationResult answers a child-run cancellation request.
type BoolResult ¶
type BoolResult struct {
Value bool `json:"value"`
}
BoolResult answers an operation whose only outcome is whether it happened.
type CancelAgentRun ¶ added in v0.21.0
CancelAgentRun names one child agent the controller wants stopped.
type CancelResult ¶
type CancelResult struct {
CancelRequested bool `json:"cancelRequested"`
}
CancelResult is the worker's answer to a cancel command.
type CheckpointRequest ¶
type CheckpointRequest struct {
Lease session.Lease `json:"lease"`
Messages []session.MessageInput `json:"messages"`
Events []session.EventInput `json:"events"`
}
CheckpointRequest appends transcript records under one lease.
type ChildInputRequest ¶
type ChildInputRequest[T any] struct { SessionID uuid.UUID `json:"sessionId"` ChildID uuid.UUID `json:"childId"` Input T `json:"input"` }
ChildInputRequest addresses one child record with a write payload.
type ChildOptionsRequest ¶
type ChildOptionsRequest[T any] struct { SessionID uuid.UUID `json:"sessionId"` ChildID uuid.UUID `json:"childId"` Options T `json:"options"` }
ChildOptionsRequest addresses one child record with read options.
type ChildRequest ¶
type ChildRequest struct {
SessionID uuid.UUID `json:"sessionId"`
ChildID uuid.UUID `json:"childId"`
}
ChildRequest addresses one record inside a session, such as a job, a model run, an agent run, or a compaction.
type Code ¶
type Code string
Code is the transport-neutral error class carried on a result frame.
It exists so a failure keeps its meaning across the socket. Without it a worker would see every controller refusal as one opaque string and could not tell a busy session from a missing record.
const ( CodeUnknown Code = "unknown" CodeNotFound Code = "notFound" CodeAlreadyExists Code = "alreadyExists" CodeConflict Code = "conflict" CodeInvalidState Code = "invalidState" CodeValidation Code = "validationFailed" CodePermissionDenied Code = "permissionDenied" CodeLockHeld Code = "lockHeld" CodeCancelled Code = "cancelled" CodeNotImplemented Code = "notImplemented" CodeRunningTurnSettingsChange Code = "runningTurnSettingsChange" CodeUserMessageQueueFull Code = "userMessageQueueFull" CodeUnknownSkill Code = "unknownSkill" CodeAgentRunFinished Code = "agentRunFinished" CodeAgentRunNotFound Code = "agentRunNotFound" CodeExecutionInboxPending Code = "executionInboxPending" )
type Command ¶
type Command string
Command names the controller-initiated operations.
const ( // CommandRunTurn hands the worker one accepted user message to run. CommandRunTurn Command = "runTurn" // CommandCancel asks the worker to cancel its session's active turn. CommandCancel Command = "cancel" // CommandSignalJob asks the worker to signal one of its running jobs. The // job's process group lives in the worker, so the controller cannot reach // it and can only record what the worker reports back. CommandSignalJob Command = "signalJob" // CommandCancelAgentRun asks the worker to stop one running child agent. // The child runs in the worker, so the controller's durable request // alone never reaches it. CommandCancelAgentRun Command = "cancelAgentRun" // CommandShutdown asks the worker to finish and exit. CommandShutdown Command = "shutdown" )
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn is one multiplexed protocol connection.
Both sides send and receive on the same socket, so each runs one read loop that answers inbound frames and completes outbound ones. A call and a command can therefore be in flight at once, which is what lets a controller cancel a turn while the worker is still asking for durable records.
func (*Conn) Call ¶
func (c *Conn) Call( ctx context.Context, kind Kind, method string, params any, ) (json.RawMessage, error)
Call issues one request and waits for its answer.
func (*Conn) Close ¶
func (c *Conn) Close()
Close ends the connection once. Closing an already-closed connection is not an error, because both the read loop and its owner may reach it.
func (*Conn) Receive ¶
Receive reads exactly one frame. Registration uses it directly, before the read loop starts.
type Connection ¶
type Connection struct {
Ack HelloAck
// contains filtered or unexported fields
}
Connection is a registered worker's side of the protocol.
func Dial ¶
func Dial( ctx context.Context, document worker.LaunchDocument, handler Handler, ) (*Connection, error)
Dial connects one worker to its controller and registers it.
The handler answers controller commands. Registration is the first thing on the wire and the only place the credential appears; a refusal means this worker must exit rather than retry, because its controller will not accept the launch it was given.
func (*Connection) Done ¶
func (c *Connection) Done() <-chan struct{}
Done closes when the connection ends.
func (*Connection) Serve ¶
func (c *Connection) Serve(ctx context.Context) error
Serve runs the worker's read loop until the controller disconnects or the context ends.
func (*Connection) Store ¶
func (c *Connection) Store() *Store
Store is the worker's durable surface over this connection.
func (*Connection) Workflows ¶ added in v0.25.0
func (c *Connection) Workflows() *WorkflowBackend
Workflows binds the registered session to the existing private transport.
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller answers one registered worker's durable calls.
It is constructed per connection and holds that worker's session and generation. Every request is checked against them, so a worker asking for a session it was not launched for is refused rather than served.
func NewController ¶
func NewController( store *session.Store, sessionID uuid.UUID, generationID uuid.UUID, ) *Controller
NewController binds one worker connection to its session.
func (*Controller) BindWorkflows ¶ added in v0.25.0
func (c *Controller) BindWorkflows( ctx context.Context, storage *db.WorkflowStorage, ) error
BindWorkflows attaches controller-owned storage to this authenticated generation. A borrowed backend never opens another database connection.
func (*Controller) HandleCall ¶
func (c *Controller) HandleCall( ctx context.Context, method string, payload json.RawMessage, ) (any, error)
HandleCall serves one durable request from the worker.
func (*Controller) HandleCommand ¶
func (c *Controller) HandleCommand( _ context.Context, command Command, _ json.RawMessage, ) (any, error)
HandleCommand is never called on the controller side. A worker does not send commands to its controller, so a command frame arriving here is a protocol violation rather than work to do.
type CreateOrResumeRequest ¶
type CreateOrResumeRequest struct {
SessionID uuid.UUID `json:"sessionId"`
Options session.OpenSessionOptions `json:"options"`
}
CreateOrResumeRequest opens the worker's own session. The controller ignores any other session ID here, because a worker opens only what it was launched for.
type Error ¶
type Error struct {
Code Code `json:"code"`
// Message is operator-facing text. It never carries a credential, because
// the controller only ever puts its own wrap messages here.
Message string `json:"message"`
}
Error is one failure as it crosses the socket.
type Frame ¶
type Frame struct {
Kind Kind `json:"kind"`
// ID correlates a call or command with its answer. It is empty on hello.
ID string `json:"id,omitempty"`
// Method names the durable operation on a call frame, and the command on a
// command frame.
Method string `json:"method,omitempty"`
Payload json.RawMessage `json:"payload,omitempty"`
// Error is set on a result frame the operation failed.
Error *Error `json:"error,omitempty"`
}
Frame is one message in either direction.
type Handler ¶
type Handler interface {
// HandleCall answers a worker's durable request.
HandleCall(
ctx context.Context,
method string,
payload json.RawMessage,
) (any, error)
// HandleCommand answers a controller's command.
HandleCommand(
ctx context.Context,
command Command,
payload json.RawMessage,
) (any, error)
}
Handler answers the frames one side receives. The controller implements the call side, the worker implements the command side, and each returns a nil payload for a frame kind it does not serve.
type HashRequest ¶
HashRequest reads one content-addressed snapshot.
type Hello ¶
type Hello struct {
SessionID uuid.UUID `json:"sessionId"`
GenerationID uuid.UUID `json:"generationId"`
Credential worker.Credential `json:"credential"`
AgentSpace string `json:"agentSpace"`
}
Hello is the worker's registration payload.
The credential is the only secret on the wire, and it travels once. A worker that names a session or generation its controller did not issue is refused and the connection is closed.
type HelloAck ¶
type HelloAck struct {
SessionID uuid.UUID `json:"sessionId"`
Workspace string `json:"workspace"`
AgentSpace string `json:"agentSpace"`
}
HelloAck confirms registration and tells the worker what its session already looks like, so it does not need a second round trip to start.
type InputRequest ¶
InputRequest addresses one session with a write payload.
type Kind ¶
type Kind string
Kind is the frame type. Both directions share one envelope so a single read loop on each side can dispatch every message.
const ( // KindHello is the worker's first frame. Nothing else is accepted before // it. KindHello Kind = "hello" // KindHelloAck answers a registration attempt. KindHelloAck Kind = "helloAck" // KindCall is a worker request for a durable operation. KindCall Kind = "call" // KindResult answers a call. KindResult Kind = "result" // KindCommand is controller-initiated work or control for the worker. KindCommand Kind = "command" // KindCommandResult answers a command. KindCommandResult Kind = "commandResult" )
type LeaseInputRequest ¶
LeaseInputRequest addresses one turn lease with a write payload.
type LeaseRequest ¶
LeaseRequest addresses one turn lease.
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
Listener is one session's private worker socket.
It accepts exactly the worker its controller launched. A second connection on the same socket is refused while one is live, because one generation is one process.
func Listen ¶
func Listen( ctx context.Context, socketPath string, sessionID uuid.UUID, registrar Registrar, store *session.Store, options ...ListenerOption, ) (*Listener, error)
Listen opens one session's private socket.
A stale socket file from a controller that died is removed first, because a Unix socket is not cleaned up by the kernel and the new controller owns this path by construction: it is named for the session and lives under the controller's own private root.
func (*Listener) Close ¶
func (l *Listener) Close()
Close stops accepting and removes the socket file.
type ListenerOption ¶ added in v0.25.0
type ListenerOption func(*Listener)
func WithWorkflowStorage ¶ added in v0.25.0
func WithWorkflowStorage(storage *db.WorkflowStorage) ListenerOption
WithWorkflowStorage lends controller storage to authenticated generations. The listener never closes the storage.
type Method ¶
type Method string
Method names one durable operation a worker may ask its controller to perform. The set is closed: a worker cannot reach a store method the controller did not publish here, which is what keeps the protocol from becoming a generic database connection.
const ( MethodGetSession Method = "session.get" MethodGetDirectoryState Method = "session.directoryState" MethodCreateOrResume Method = "session.createOrResume" MethodCompletedHistory Method = "session.completedHistory" MethodAcquireTurn Method = "turn.acquire" MethodAppendCheckpoint Method = "turn.appendCheckpoint" MethodFinalizeTurn Method = "turn.finalize" MethodReleaseTurn Method = "turn.release" MethodRecordTurnWorker Method = "turn.recordWorkerGeneration" MethodCancelSession Method = "turn.cancel" MethodListTurns Method = "turn.list" MethodListMessages Method = "message.list" MethodListEvents Method = "event.list" MethodCreateModelRun Method = "modelRun.create" MethodFinalizeModelRun Method = "modelRun.finalize" MethodGetModelRun Method = "modelRun.get" MethodListModelRuns Method = "modelRun.list" MethodCreateModelCall Method = "modelCall.create" MethodFinalizeModelCall Method = "modelCall.finalize" MethodRecordModelCallRetries Method = "modelCall.recordRetries" MethodListModelCalls Method = "modelCall.list" MethodCreateJob Method = "job.create" MethodFinalizeJob Method = "job.finalize" MethodGetJob Method = "job.get" MethodListJobs Method = "job.list" MethodAppendJobOutput Method = "job.appendOutput" MethodListJobOutput Method = "job.listOutput" MethodRecordJobSignal Method = "job.recordSignal" MethodListJobSignalRequests Method = "job.listSignalRequests" MethodCreateAgentRun Method = "agentRun.create" MethodClaimAgentRun Method = "agentRun.claim" MethodPrepareAgentRunRecovery Method = "agentRun.prepareRecovery" MethodFinalizeAgentRun Method = "agentRun.finalize" MethodGetAgentRun Method = "agentRun.get" MethodListAgentRuns Method = "agentRun.list" MethodAppendAgentRunEvent Method = "agentRun.appendEvent" MethodListAgentRunEvents Method = "agentRun.listEvents" MethodCancelAgentRun Method = "agentRun.requestCancellation" MethodOpenAgentRunQuestions Method = "agentRun.openQuestions" MethodAppendAgentRunMessages Method = "agentRun.appendMessages" MethodListAgentRunMessages Method = "agentRun.listMessages" MethodAgentRunHistory Method = "agentRun.history" MethodCreateAgentRunCompaction Method = "agentRun.createCompaction" MethodLatestAgentRunCompaction Method = "agentRun.latestCompaction" MethodListAgentRunCompactions Method = "agentRun.listCompactions" MethodGetAgentRunCompaction Method = "agentRun.getCompaction" MethodCreateCompaction Method = "compaction.create" MethodGetCompaction Method = "compaction.get" MethodListCompactions Method = "compaction.list" MethodLatestCompaction Method = "compaction.latest" MethodSaveContextSnapshot Method = "snapshot.saveContext" MethodGetContextSnapshot Method = "snapshot.getContext" MethodSavePromptSnapshot Method = "snapshot.savePrompt" MethodGetPromptSnapshot Method = "snapshot.getPrompt" MethodCreateSessionNotice Method = "notice.create" MethodListSessionNotices Method = "notice.list" MethodDrainSessionNotices Method = "notice.drain" )
type NestedChildInputRequest ¶
type NestedChildInputRequest[T any] struct { SessionID uuid.UUID `json:"sessionId"` ChildID uuid.UUID `json:"childId"` NestedID uuid.UUID `json:"nestedId"` Input T `json:"input"` }
NestedChildInputRequest addresses a record inside a child record, which is only the model call inside a model run.
type NestedChildRequest ¶ added in v0.11.0
type NestedChildRequest struct {
SessionID uuid.UUID `json:"sessionId"`
ChildID uuid.UUID `json:"childId"`
NestedID uuid.UUID `json:"nestedId"`
}
NestedChildRequest addresses a record inside a child record for a read, which is a compaction inside one agent run.
type OptionsRequest ¶
type OptionsRequest[T any] struct { SessionID uuid.UUID `json:"sessionId"` Options T `json:"options"` }
OptionsRequest addresses one session with read options.
type RecordTurnWorkerRequest ¶
type RecordTurnWorkerRequest struct {
Lease session.Lease `json:"lease"`
GenerationID uuid.UUID `json:"generationId"`
}
RecordTurnWorkerRequest names the worker generation that ran one turn.
type Registrar ¶
type Registrar interface {
AcceptWorker(ctx context.Context, hello Hello) (HelloAck, error)
// WorkerConnected reports an accepted worker once Connected returns it
// and its hello ack is sent. AcceptWorker runs before the listener
// installs the worker, so it cannot be the readiness signal.
WorkerConnected(sessionID, generationID uuid.UUID)
}
Registrar verifies one worker's registration.
The supervisor implements it against the durable generation record, so a worker is accepted only when the controller itself recorded that session, that generation, and that credential hash.
type RunTurn ¶
type RunTurn struct {
ExpectedStopRevision *int64 `json:"expectedStopRevision,omitempty"`
RequestID uuid.UUID `json:"requestId"`
Message string `json:"message"`
Model string `json:"model,omitempty"`
ReasoningEffort string `json:"reasoningEffort,omitempty"`
SystemPrompt string `json:"systemPrompt,omitempty"`
PromptMode string `json:"promptMode,omitempty"`
// Origin is set only for a turn a session event started. The worker runs
// it as a woken turn, so its prompt is stored as injected rather than as
// something a person typed.
Origin *TurnOrigin `json:"origin,omitempty"`
// To names a running child agent. The worker puts the message in that
// child's inbox and starts no turn.
To *uuid.UUID `json:"to,omitempty"`
}
RunTurn is the payload of a runTurn command.
The controller has already recorded the accepted user message, so this carries the routing identity and the text, never a session the worker may choose.
type SessionRequest ¶
SessionRequest addresses one session.
Every envelope carries the session ID even though the socket is already bound to one session. The controller checks the two agree and refuses the frame when they do not, so a worker that guesses another session's ID still gets nowhere.
type SignalJobResult ¶
type SignalJobResult struct {
Handled bool `json:"handled"`
// Signalled is true when the worker found the job running and signalled it.
Signalled bool `json:"signalled"`
// State is the job's state at the moment it was signalled.
State string `json:"state"`
}
SignalJobResult is the worker's answer to a signal command.
Handled is false when this worker holds no such running job, which is not an error: the job may have exited between the read the caller acted on and this command arriving.
type SnapshotRequest ¶
type SnapshotRequest[T any] struct { SessionID uuid.UUID `json:"sessionId"` Snapshot T `json:"snapshot"` }
SnapshotRequest stores one immutable snapshot. The session ID travels beside it so the controller can check ownership before writing.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a worker's durable surface.
Every record goes to the controller, which writes it to SQLite and publishes it. The worker holds no database handle and no generic control credential. The lease and its cancellation stay in the worker's own memory, because the worker is the only process that runs turns for its session and cancellation has to reach a live goroutine rather than a row.
func (*Store) AcceptChildExecutionMessage ¶ added in v0.25.0
func (s *Store) AcceptChildExecutionMessage( ctx context.Context, sessionID, executionID uuid.UUID, input session.AcceptExecutionMessageInput, ) (*session.ExecutionInboxAcceptance, error)
func (*Store) AcceptExecutionMessage ¶ added in v0.25.0
func (*Store) AcquireDeferredExecutionTurn ¶ added in v0.25.0
func (s *Store) AcquireDeferredExecutionTurn( ctx context.Context, sessionID, inboxID uuid.UUID, input session.StartTurnInput, ) (*session.DeferredTurnAdmission, error)
func (*Store) AcquireTurn ¶
func (s *Store) AcquireTurn( ctx context.Context, sessionID uuid.UUID, input session.StartTurnInput, ) (session.Lease, error)
AcquireTurn reserves the durable lease on the controller, then records it locally so cancellation can reach this process.
func (*Store) AgentRunHistory ¶ added in v0.11.0
func (*Store) AppendAgentRunEvent ¶
func (*Store) AppendAgentRunMessages ¶ added in v0.11.0
func (*Store) AppendCheckpoint ¶
func (s *Store) AppendCheckpoint( ctx context.Context, lease session.Lease, messages []session.MessageInput, events []session.EventInput, ) error
func (*Store) AppendJobOutput ¶
func (*Store) BeginExecutionActivity ¶ added in v0.25.0
func (s *Store) BeginExecutionActivity( ctx context.Context, sessionID, executionID, generationID uuid.UUID, input session.ScheduleActivityInput, ) (*session.ActivityClaim, error)
func (*Store) Cancel ¶
Cancel records the request durably, then reaches the running turn in this process.
func (*Store) ClaimAgentRun ¶ added in v0.24.0
func (*Store) CompleteExecutionActivity ¶ added in v0.25.0
func (s *Store) CompleteExecutionActivity( ctx context.Context, sessionID uuid.UUID, lease session.ActivityLease, input session.CompleteActivityInput, ) (*models.ExecutionActivity, error)
func (*Store) CompletedHistory ¶
func (*Store) CreateAgentRun ¶
func (*Store) CreateAgentRunCompaction ¶ added in v0.11.0
func (*Store) CreateCompaction ¶
func (s *Store) CreateCompaction( ctx context.Context, sessionID uuid.UUID, input session.CompactionInput, ) (*models.Compaction, error)
func (*Store) CreateExecution ¶ added in v0.25.0
func (*Store) CreateModelCall ¶
func (*Store) CreateModelRun ¶
func (*Store) CreateOrResume ¶
func (s *Store) CreateOrResume( ctx context.Context, _ *uuid.UUID, options session.OpenSessionOptions, ) (*session.OpenSessionResult, error)
func (*Store) CreateSessionNotice ¶
func (s *Store) CreateSessionNotice( ctx context.Context, sessionID uuid.UUID, input session.CreateSessionNoticeInput, ) (*models.SessionNotice, error)
func (*Store) CreateWorkerGeneration ¶
func (s *Store) CreateWorkerGeneration( _ context.Context, _ uuid.UUID, _ session.CreateWorkerGenerationInput, ) (*models.WorkerGeneration, error)
func (*Store) DeferExecutionMessage ¶ added in v0.25.0
func (*Store) DeliverChildExecutionMessages ¶ added in v0.25.0
func (*Store) DeliverExecutionMessages ¶ added in v0.25.0
func (s *Store) DeliverExecutionMessages( ctx context.Context, sessionID uuid.UUID, input session.DeliverExecutionMessagesInput, ) (*session.ExecutionInboxDelivery, error)
func (*Store) DrainSessionNotices ¶
func (*Store) FinalizeAgentRun ¶
func (*Store) FinalizeJob ¶
func (*Store) FinalizeModelCall ¶
func (*Store) FinalizeModelRun ¶
func (*Store) FinalizeTurn ¶
func (s *Store) FinalizeTurn( ctx context.Context, lease session.Lease, input session.FinalizeTurnInput, ) error
FinalizeTurn writes the turn's terminal state and ends it locally, matching the controller's store, which releases its lease on finalize. Nothing else in a worker releases a finished turn, so without this the session would look busy here forever and no event could wake it.
func (*Store) GenerationID ¶
GenerationID is the worker generation this store records turns under.
func (*Store) GetAgentRun ¶
func (*Store) GetAgentRunCompaction ¶ added in v0.11.0
func (*Store) GetCompaction ¶
func (*Store) GetContextSnapshot ¶
func (*Store) GetDirectoryState ¶ added in v0.24.0
func (*Store) GetExecution ¶ added in v0.25.0
func (*Store) GetExecutionActivity ¶ added in v0.25.0
func (*Store) GetExecutionMessageByRequest ¶ added in v0.25.0
func (*Store) GetExecutionRootTurn ¶ added in v0.25.0
func (*Store) GetExecutionTurnLease ¶ added in v0.25.0
func (*Store) GetPromptSnapshot ¶
func (*Store) InterruptExecutionActivity ¶ added in v0.25.0
func (*Store) LatestAgentRunCompaction ¶ added in v0.11.0
func (*Store) LatestCompaction ¶
func (*Store) ListAgentRunCompactions ¶ added in v0.11.0
func (*Store) ListAgentRunEvents ¶
func (*Store) ListAgentRunMessages ¶ added in v0.11.0
func (*Store) ListAgentRuns ¶
func (s *Store) ListAgentRuns( ctx context.Context, sessionID uuid.UUID, options session.ListAgentRunsOptions, ) (*session.AgentRunPage, error)
func (*Store) ListCompactions ¶
func (s *Store) ListCompactions( ctx context.Context, sessionID uuid.UUID, options session.ListCompactionsOptions, ) (*session.CompactionPage, error)
func (*Store) ListDeferredExecutionMessages ¶ added in v0.25.0
func (s *Store) ListDeferredExecutionMessages( ctx context.Context, sessionID uuid.UUID, options session.ListEventsOptions, ) (*session.ExecutionInboxPage, error)
func (*Store) ListEvents ¶
func (*Store) ListExecutionActivities ¶ added in v0.25.0
func (s *Store) ListExecutionActivities( ctx context.Context, sessionID, executionID uuid.UUID, options session.ListEventsOptions, ) (*session.ExecutionActivityPage, error)
func (*Store) ListExecutionEvents ¶ added in v0.25.0
func (s *Store) ListExecutionEvents( ctx context.Context, sessionID, executionID uuid.UUID, options session.ListEventsOptions, ) (*session.ExecutionEventPage, error)
func (*Store) ListExecutionMessages ¶ added in v0.25.0
func (s *Store) ListExecutionMessages( ctx context.Context, sessionID, executionID uuid.UUID, options session.ListExecutionInboxOptions, ) (*session.ExecutionInboxPage, error)
func (*Store) ListJobOutput ¶
func (*Store) ListJobSignalRequests ¶
func (*Store) ListMessages ¶
func (s *Store) ListMessages( ctx context.Context, sessionID uuid.UUID, options session.ListMessagesOptions, ) (*session.MessagePage, error)
func (*Store) ListModelCalls ¶
func (*Store) ListModelRuns ¶
func (s *Store) ListModelRuns( ctx context.Context, sessionID uuid.UUID, options session.ListModelRunsOptions, ) (*session.ModelRunPage, error)
func (*Store) ListSessionNotices ¶
func (s *Store) ListSessionNotices( ctx context.Context, sessionID uuid.UUID, options session.ListSessionNoticesOptions, ) (*session.NoticePage, error)
func (*Store) OpenAgentRunQuestions ¶ added in v0.21.0
func (s *Store) OpenAgentRunQuestions( ctx context.Context, sessionID uuid.UUID, ) (map[uuid.UUID]string, error)
OpenAgentRunQuestions reads the questions the session's running children are waiting on.
func (*Store) OpenWorkspace ¶
func (s *Store) OpenWorkspace( _ context.Context, _ string, _ session.OpenSessionOptions, ) (*session.OpenSessionResult, error)
OpenWorkspace is a control-plane operation. Only the controller resolves a workspace to a session, because that is where the workspace policy lives.
func (*Store) PauseExecution ¶ added in v0.25.0
func (*Store) PrepareAgentRunRecovery ¶ added in v0.24.0
func (*Store) RecordJobSignal ¶
func (*Store) RecordModelCallRetries ¶
func (*Store) RecordTurnWorkerGeneration ¶
func (s *Store) RecordTurnWorkerGeneration( ctx context.Context, lease session.Lease, generationID uuid.UUID, ) error
RecordTurnWorkerGeneration names this worker as the process that ran a turn. The controller refuses any generation but this worker's own.
func (*Store) RecoverInterrupted ¶
func (*Store) RecoverInterruptedAgentRuns ¶
func (*Store) RecoverInterruptedJobs ¶
func (*Store) RecoverInterruptedModelRuns ¶
func (*Store) RegisterCancellation ¶
func (s *Store) RegisterCancellation( lease session.Lease, cancel context.CancelFunc, )
RegisterCancellation attaches this process's cancellation to a live lease. A cancellation that already arrived fires immediately, so a turn cancelled between acquiring the lease and starting work does not run anyway.
func (*Store) ReleaseTurn ¶
ReleaseTurn drops the local lease and waits for the controller to drop its own, so the next accepted message is not refused as busy.
func (*Store) RequestAgentRunCancellation ¶
func (*Store) RequestLocalCancellation ¶
RequestLocalCancellation fires the running turn's cancellation without a durable write. The controller calls it through the cancel command, which it sends after it has already recorded the request.
func (*Store) ReserveExecutionCompletion ¶ added in v0.25.0
func (s *Store) ReserveExecutionCompletion( ctx context.Context, sessionID uuid.UUID, lease session.ActivityLease, ) (*session.ExecutionCompletionSeal, error)
func (*Store) ResolveExecutionActivity ¶ added in v0.25.0
func (s *Store) ResolveExecutionActivity( ctx context.Context, sessionID, activityID uuid.UUID, input session.ResolveActivityInput, ) (*models.ExecutionActivity, error)
func (*Store) ResolveExecutionActivityFromActivity ¶ added in v0.25.0
func (s *Store) ResolveExecutionActivityFromActivity( ctx context.Context, sessionID, activityID uuid.UUID, input session.ResolveExecutionControlInput, ) (*models.ExecutionActivity, error)
func (*Store) RestoreExecutionTurn ¶ added in v0.25.0
func (*Store) ResumeExecution ¶ added in v0.25.0
func (*Store) ResumeExecutionFromActivity ¶ added in v0.25.0
func (*Store) SaveContextSnapshot ¶
func (*Store) SavePromptSnapshot ¶
func (*Store) SearchExecutions ¶ added in v0.25.0
func (s *Store) SearchExecutions( ctx context.Context, sessionID uuid.UUID, options session.SearchExecutionsOptions, ) (*session.ExecutionPage, error)
type TurnOrigin ¶ added in v0.15.1
TurnOrigin names the session event that started a turn.
type TurnResult ¶
TurnResult is the worker's answer to a runTurn command.
type Worker ¶
type Worker struct {
SessionID uuid.UUID
GenerationID uuid.UUID
// contains filtered or unexported fields
}
Worker is a registered worker as the controller holds it.
func (*Worker) CancelAgentRun ¶ added in v0.21.0
CancelAgentRun asks the worker to stop one running child agent. False means this worker holds no such running child.
func (*Worker) Disconnect ¶
func (w *Worker) Disconnect()
Disconnect drops the connection without waiting for the worker.
func (*Worker) Done ¶
func (w *Worker) Done() <-chan struct{}
Done closes when the worker's connection ends.
func (*Worker) RunTurn ¶
RunTurn hands one accepted user message to the worker and waits for its answer.
func (*Worker) SignalJob ¶
func (w *Worker) SignalJob( ctx context.Context, jobID uuid.UUID, signal string, ) (SignalJobResult, error)
SignalJob asks the worker to signal one of its running jobs.
A worker that no longer holds the job answers Handled false rather than an error, because the job may have exited between the caller's read and this command.
type WorkflowBackend ¶ added in v0.25.0
type WorkflowBackend struct {
// contains filtered or unexported fields
}
WorkflowBackend runs the native workflow worker over its authenticated controller connection. It never opens or closes controller storage.
func NewWorkflowBackend ¶ added in v0.25.0
func NewWorkflowBackend(conn *Conn, sessionID uuid.UUID) *WorkflowBackend
func (*WorkflowBackend) CancelWorkflowInstance ¶ added in v0.25.0
func (*WorkflowBackend) Close ¶ added in v0.25.0
func (b *WorkflowBackend) Close() error
func (*WorkflowBackend) CompleteActivityTask ¶ added in v0.25.0
func (b *WorkflowBackend) CompleteActivityTask( ctx context.Context, task *backend.ActivityTask, result *history.Event, ) error
func (*WorkflowBackend) CompleteWorkflowTask ¶ added in v0.25.0
func (b *WorkflowBackend) CompleteWorkflowTask( ctx context.Context, task *backend.WorkflowTask, state core.WorkflowInstanceState, executed, activities, timers []*history.Event, targets []*history.WorkflowEvent, ) error
func (*WorkflowBackend) CreateWorkflowInstance ¶ added in v0.25.0
func (*WorkflowBackend) ExtendActivityTask ¶ added in v0.25.0
func (b *WorkflowBackend) ExtendActivityTask( ctx context.Context, task *backend.ActivityTask, ) error
func (*WorkflowBackend) ExtendWorkflowTask ¶ added in v0.25.0
func (b *WorkflowBackend) ExtendWorkflowTask( ctx context.Context, task *backend.WorkflowTask, ) error
func (*WorkflowBackend) FeatureSupported ¶ added in v0.25.0
func (b *WorkflowBackend) FeatureSupported(_ backend.Feature) bool
func (*WorkflowBackend) GetActivityTask ¶ added in v0.25.0
func (b *WorkflowBackend) GetActivityTask( ctx context.Context, queues []workflow.Queue, ) (*backend.ActivityTask, error)
func (*WorkflowBackend) GetWorkflowInstanceHistory ¶ added in v0.25.0
func (*WorkflowBackend) GetWorkflowInstanceState ¶ added in v0.25.0
func (b *WorkflowBackend) GetWorkflowInstanceState( ctx context.Context, instance *workflow.Instance, ) (core.WorkflowInstanceState, error)
func (*WorkflowBackend) GetWorkflowTask ¶ added in v0.25.0
func (b *WorkflowBackend) GetWorkflowTask( ctx context.Context, queues []workflow.Queue, ) (*backend.WorkflowTask, error)
func (*WorkflowBackend) Metrics ¶ added in v0.25.0
func (b *WorkflowBackend) Metrics() metrics.Client
func (*WorkflowBackend) Options ¶ added in v0.25.0
func (b *WorkflowBackend) Options() *backend.Options
func (*WorkflowBackend) PrepareActivityQueues ¶ added in v0.25.0
func (*WorkflowBackend) PrepareWorkflowQueues ¶ added in v0.25.0
func (*WorkflowBackend) RemoveWorkflowInstance ¶ added in v0.25.0
func (*WorkflowBackend) RemoveWorkflowInstances ¶ added in v0.25.0
func (b *WorkflowBackend) RemoveWorkflowInstances( _ context.Context, _ ...backend.RemovalOption, ) error
func (*WorkflowBackend) SignalWorkflow ¶ added in v0.25.0
func (*WorkflowBackend) Tracer ¶ added in v0.25.0
func (b *WorkflowBackend) Tracer() trace.Tracer
Source Files
¶
- conn.go
- controller.go
- deferredturn.go
- dialer.go
- errors.go
- executionagentcontrol.go
- executionagentresolution.go
- executioncontroller.go
- executiondeferred.go
- executioninbox.go
- executionseal.go
- executionstore.go
- executionturn.go
- executiontypes.go
- frames.go
- listener.go
- methods.go
- store.go
- turnlease.go
- workflowbackend.go
- workflowconnection.go
- workflowcontroller.go
- workflowevent.go
- workflowtypes.go