runtime

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2025 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigurePayloadCodecs

func ConfigurePayloadCodecs(codecs ...converter.PayloadCodec)

ConfigurePayloadCodecs installs the provided payload codecs on top of the runtime's data converter. Passing no codecs restores the plain CBOR converter.

func DataConverter

func DataConverter() converter.DataConverter

DataConverter exposes the runtime's CBOR-backed data converter so external clients (e.g., HTTP gateways) can encode/decode payloads consistently with actors.

func NewEncryptionCodec

func NewEncryptionCodec(key []byte) (converter.PayloadCodec, error)

NewEncryptionCodec creates a Temporal payload codec that wraps payloads in AES-GCM ciphertext.

func RegisterTemporalClient

func RegisterTemporalClient(cli TemporalClient)

RegisterTemporalClient wires a Temporal client into the actors.Client invoker pipeline.

func SetAskRoutingMode

func SetAskRoutingMode(mode AskRoutingMode)

SetAskRoutingMode switches between signal-based asks and future update routing.

func SetDefaultAskTimeout

func SetDefaultAskTimeout(d time.Duration)

SetDefaultAskTimeout overrides the timeout used by actor-to-actor asks. Set to zero to disable.

func SetDefaultQueryTimeout

func SetDefaultQueryTimeout(d time.Duration)

SetDefaultQueryTimeout overrides the timeout used by actor-to-actor queries. Set to zero to disable.

Types

type AskRoutingMode

type AskRoutingMode int32
const (
	AskRouteSignal AskRoutingMode = iota
	AskRouteUpdate
)

type Registration

type Registration struct {
	Kind          string
	WorkflowQueue string
	ActivityQueue string
}

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

Runner wires an actor description into a Temporal workflow entrypoint.

func NewRunner

func NewRunner(actor actors.Actor) *Runner

NewRunner clones the actor description so the runtime can own its copy.

func (*Runner) Activities

func (r *Runner) Activities() map[string]interface{}

Activities returns wrappers suitable for registering with Temporal workers or tests.

func (*Runner) AddActivityObserver

func (r *Runner) AddActivityObserver(observer func(string, actors.ActivityCallOptions))

AddActivityObserver registers a hook invoked with merged activity call options before execution.

func (*Runner) Description

func (r *Runner) Description() *actors.Description

Description returns a clone of the underlying description.

func (*Runner) RegisterWorkflow

func (r *Runner) RegisterWorkflow(register func(workflow interface{}))

RegisterWorkflow is a helper that registers the workflow with a worker/tests suite.

func (*Runner) Workflow

func (r *Runner) Workflow() interface{}

Workflow returns a Temporal workflow function that drives the actor description.

type TemporalClient

type TemporalClient interface {
	SignalWorkflow(ctx context.Context, workflowID, runID, signalName string, arg interface{}) error
	SignalWithStartWorkflow(ctx context.Context, workflowID, signalName string, arg interface{}, options client.StartWorkflowOptions, workflow interface{}, workflowArgs ...interface{}) (client.WorkflowRun, error)
	QueryWorkflow(ctx context.Context, workflowID, runID, queryType string, args ...interface{}) (converter.EncodedValue, error)
	UpdateWorkflow(ctx context.Context, options client.UpdateWorkflowOptions) (client.WorkflowUpdateHandle, error)
	DescribeWorkflowExecution(ctx context.Context, workflowID, runID string) (*workflowservicepb.DescribeWorkflowExecutionResponse, error)
	ExecuteWorkflow(ctx context.Context, options client.StartWorkflowOptions, workflow interface{}, args ...interface{}) (client.WorkflowRun, error)
}

TemporalClient describes the subset of the Temporal Go SDK client needed to implement actor client proxies.

type WorkerConfig

type WorkerConfig struct {
	WorkflowQueue         string
	ActivityQueue         string
	WorkerOptions         *worker.Options
	ActivityWorkerOptions *worker.Options
}

type WorkerHealthSnapshot

type WorkerHealthSnapshot struct {
	WorkflowQueues []WorkerQueueStatus
	ActivityQueues []WorkerQueueStatus
}

WorkerHealthSnapshot summarizes the worker fleet at a point in time.

type WorkerQueueStatus

type WorkerQueueStatus struct {
	Queue      string
	Running    bool
	Disabled   bool
	ActorKinds []string
}

WorkerQueueStatus captures queue-level health metrics.

type WorkerSet

type WorkerSet struct {
	// contains filtered or unexported fields
}

func NewWorkerSet

func NewWorkerSet(c client.Client, defaults ...WorkerConfig) *WorkerSet

func (*WorkerSet) HealthSnapshot

func (s *WorkerSet) HealthSnapshot() WorkerHealthSnapshot

HealthSnapshot reports queue-level status for workflow and activity workers.

func (*WorkerSet) Register

func (s *WorkerSet) Register(actor actors.Actor, cfg WorkerConfig) (Registration, error)

func (*WorkerSet) StartAll

func (s *WorkerSet) StartAll(ctx context.Context) error

func (*WorkerSet) StopAll

func (s *WorkerSet) StopAll()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL