manager

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WorkflowQueue = "rla-tasks"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ClientConf    temporal.Config
	WorkerOptions map[string]worker.Options

	// ComponentManagerRegistry is the registry containing initialized component managers.
	ComponentManagerRegistry *componentmanager.Registry
}

Config holds all configuration required to build a Temporal-backed executor. WorkerOptions maps Temporal task-queue names to per-queue worker settings; each key results in a dedicated worker started by Build.

func (*Config) Build

func (c *Config) Build(
	ctx context.Context,
	updater task.TaskStatusUpdater,
) (executor.Executor, error)

Build creates the Temporal executor: it wires the status updater and component manager registry into the activity layer, then starts the Temporal clients and workers for each configured queue. On success the caller must eventually call Stop() to release the Temporal client connections — typically via defer, regardless of whether Start() succeeds.

func (*Config) Validate

func (c *Config) Validate() error

Validate checks that the configuration is complete and consistent. It validates the Temporal client config.

type Manager

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

Manager is the Temporal implementation of executor.Executor. It owns two Temporal clients (publisher for workflow submission and status queries, subscriber for worker registration) and one worker per configured task queue.

func (*Manager) CheckStatus

func (m *Manager) CheckStatus(
	ctx context.Context,
	encodedExecutionID string,
) (taskcommon.TaskStatus, error)

CheckStatus decodes the execution ID and queries Temporal for the current workflow execution status, mapping it to a TaskStatus.

func (*Manager) Execute added in v1.4.0

func (m *Manager) Execute(
	ctx context.Context,
	req *task.ExecutionRequest,
) (*task.ExecutionResponse, error)

Execute dispatches the task to the Temporal workflow registered for its OperationType. All Temporal mechanics (client, options, workflow submission) are contained here — nothing engine-specific crosses the Executor boundary.

func (*Manager) Start

func (m *Manager) Start(ctx context.Context) error

Start begins polling for workflow and activity tasks on all configured queues.

func (*Manager) Stop

func (m *Manager) Stop(ctx context.Context) error

Stop is the full teardown for a Manager created by Build: it stops all workers (safe to call even if Start was never called or failed partway) and closes the Temporal client connections.

func (*Manager) TerminateTask

func (m *Manager) TerminateTask(
	ctx context.Context,
	encodedExecutionID string,
	reason string,
) error

TerminateTask terminates the Temporal workflow backing the given execution ID.

func (*Manager) Type

func (m *Manager) Type() taskcommon.ExecutorType

Type returns ExecutorTypeTemporal, identifying this executor implementation.

Jump to

Keyboard shortcuts

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