common

package
v1.9.5 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package common is a generated GoMock package.

Index

Constants

View Source
const WorkerComponentTag = `group:"workerComponent"`

WorkerComponentTag is the fx group tag for worker components. This is used to allow those who use Temporal as a library to dynamically register their own system workers. Use this to annotate a worker component consumer. Use the AnnotateWorkerComponentProvider function to annotate a worker component provider.

Variables

This section is empty.

Functions

func AnnotateWorkerComponentProvider

func AnnotateWorkerComponentProvider[T any](f func(t T) WorkerComponent) fx.Option

AnnotateWorkerComponentProvider converts a WorkerComponent factory function into an fx provider which will add the WorkerComponentTag to the result.

func ArchetypeIDFromExecutionInfo

func ArchetypeIDFromExecutionInfo(
	executionInfo *workflowpb.WorkflowExecutionInfo,
) (chasm.ArchetypeID, error)

Types

type DedicatedWorkerOptions

type DedicatedWorkerOptions struct {
	// TaskQueue is optional
	TaskQueue string
	// How many worker nodes should run a worker per namespace
	NumWorkers int
	// Other worker options
	Options sdkworker.Options
}

type MockPerNSWorkerComponent

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

MockPerNSWorkerComponent is a mock of PerNSWorkerComponent interface.

func NewMockPerNSWorkerComponent

func NewMockPerNSWorkerComponent(ctrl *gomock.Controller) *MockPerNSWorkerComponent

NewMockPerNSWorkerComponent creates a new mock instance.

func (*MockPerNSWorkerComponent) DedicatedWorkerOptions

func (m *MockPerNSWorkerComponent) DedicatedWorkerOptions(arg0 *namespace.Namespace) *PerNSDedicatedWorkerOptions

DedicatedWorkerOptions mocks base method.

func (*MockPerNSWorkerComponent) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockPerNSWorkerComponent) Register

func (m *MockPerNSWorkerComponent) Register(arg0 worker.Registry, arg1 *namespace.Namespace, arg2 RegistrationDetails) func()

Register mocks base method.

type MockPerNSWorkerComponentMockRecorder

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

MockPerNSWorkerComponentMockRecorder is the mock recorder for MockPerNSWorkerComponent.

func (*MockPerNSWorkerComponentMockRecorder) DedicatedWorkerOptions

func (mr *MockPerNSWorkerComponentMockRecorder) DedicatedWorkerOptions(arg0 any) *gomock.Call

DedicatedWorkerOptions indicates an expected call of DedicatedWorkerOptions.

func (*MockPerNSWorkerComponentMockRecorder) Register

func (mr *MockPerNSWorkerComponentMockRecorder) Register(arg0, arg1, arg2 any) *gomock.Call

Register indicates an expected call of Register.

type MockWorkerComponent

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

MockWorkerComponent is a mock of WorkerComponent interface.

func NewMockWorkerComponent

func NewMockWorkerComponent(ctrl *gomock.Controller) *MockWorkerComponent

NewMockWorkerComponent creates a new mock instance.

func (*MockWorkerComponent) DedicatedActivityWorkerOptions

func (m *MockWorkerComponent) DedicatedActivityWorkerOptions() *DedicatedWorkerOptions

DedicatedActivityWorkerOptions mocks base method.

func (*MockWorkerComponent) DedicatedWorkflowWorkerOptions

func (m *MockWorkerComponent) DedicatedWorkflowWorkerOptions() *DedicatedWorkerOptions

DedicatedWorkflowWorkerOptions mocks base method.

func (*MockWorkerComponent) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockWorkerComponent) RegisterActivities

func (m *MockWorkerComponent) RegisterActivities(registry worker.Registry)

RegisterActivities mocks base method.

func (*MockWorkerComponent) RegisterWorkflow

func (m *MockWorkerComponent) RegisterWorkflow(registry worker.Registry)

RegisterWorkflow mocks base method.

type MockWorkerComponentMockRecorder

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

MockWorkerComponentMockRecorder is the mock recorder for MockWorkerComponent.

func (*MockWorkerComponentMockRecorder) DedicatedActivityWorkerOptions

func (mr *MockWorkerComponentMockRecorder) DedicatedActivityWorkerOptions() *gomock.Call

DedicatedActivityWorkerOptions indicates an expected call of DedicatedActivityWorkerOptions.

func (*MockWorkerComponentMockRecorder) DedicatedWorkflowWorkerOptions

func (mr *MockWorkerComponentMockRecorder) DedicatedWorkflowWorkerOptions() *gomock.Call

DedicatedWorkflowWorkerOptions indicates an expected call of DedicatedWorkflowWorkerOptions.

func (*MockWorkerComponentMockRecorder) RegisterActivities

func (mr *MockWorkerComponentMockRecorder) RegisterActivities(registry any) *gomock.Call

RegisterActivities indicates an expected call of RegisterActivities.

func (*MockWorkerComponentMockRecorder) RegisterWorkflow

func (mr *MockWorkerComponentMockRecorder) RegisterWorkflow(registry any) *gomock.Call

RegisterWorkflow indicates an expected call of RegisterWorkflow.

type PerNSDedicatedWorkerOptions

type PerNSDedicatedWorkerOptions struct {
	// Set this to false to disable this worker for this namespace
	Enabled bool
}

type PerNSWorkerComponent

type PerNSWorkerComponent interface {
	// Register registers Workflow and Activity types provided by this worker component.
	// The namespace that this worker is running in is also provided.
	// If Register returns a function, that function will be called when the worker is
	// stopped. This can be used to clean up any state.
	Register(sdkworker.Registry, *namespace.Namespace, RegistrationDetails) func()
	// DedicatedWorkerOptions returns a PerNSDedicatedWorkerOptions for this worker component.
	DedicatedWorkerOptions(*namespace.Namespace) *PerNSDedicatedWorkerOptions
}

PerNSWorkerComponent represents a per-namespace worker needed for worker role

type RegistrationDetails

type RegistrationDetails struct {
	// TotalWorkers is the number of requested per-namespace workers for this namespace.
	TotalWorkers int
	// Multiplicity is the number of those workers that this particular sdkworker.Worker
	// represents. It may be more than one if the requested number is more than the total
	// number of worker nodes or if consistent hashing decided to place more than one on
	// the same node.
	Multiplicity int
}

type WorkerComponent

type WorkerComponent interface {
	// RegisterWorkflow registers Workflow types provided by this worker component.
	// Local Activities should also be registered here because they are executed on the workflow worker.
	RegisterWorkflow(registry sdkworker.Registry)
	// DedicatedWorkflowWorkerOptions returns a DedicatedWorkerOptions for this worker component.
	// Return nil to use default worker instance.
	DedicatedWorkflowWorkerOptions() *DedicatedWorkerOptions
	// RegisterActivities registers remote Activity types provided by this worker component.
	// Local Activities should be registered in RegisterWorkflow
	RegisterActivities(registry sdkworker.Registry)
	// DedicatedActivityWorkerOptions returns a DedicatedWorkerOptions for this worker component.
	// Return nil to use default worker instance.
	DedicatedActivityWorkerOptions() *DedicatedWorkerOptions
}

WorkerComponent represents a type of work needed for worker role

Jump to

Keyboard shortcuts

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