common

package
v1.24.0-m2.6 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 7 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 added in v1.23.0

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.

Types

type ActivityWorkerLimitsConfig added in v1.23.0

type ActivityWorkerLimitsConfig struct {
	// copy of relevant remote activity controls from sdkworker.Options
	MaxConcurrentActivityExecutionSize int
	TaskQueueActivitiesPerSecond       float64
	WorkerActivitiesPerSecond          float64
	MaxConcurrentActivityTaskPollers   int
}

func NewActivityWorkerConcurrencyConfig added in v1.23.0

func NewActivityWorkerConcurrencyConfig(
	dc *dynamicconfig.Collection,
	key dynamicconfig.Key,
	defaults map[string]any,
) ActivityWorkerLimitsConfig

NewActivityWorkerConcurrencyConfig constructs an ActivityWorkerLimitsConfig from the map of values identified by key in the dynamic collection. Any errors are ignored and 0 values will be returned instead.

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 added in v1.17.0

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

MockPerNSWorkerComponent is a mock of PerNSWorkerComponent interface.

func NewMockPerNSWorkerComponent added in v1.17.0

func NewMockPerNSWorkerComponent(ctrl *gomock.Controller) *MockPerNSWorkerComponent

NewMockPerNSWorkerComponent creates a new mock instance.

func (*MockPerNSWorkerComponent) DedicatedWorkerOptions added in v1.17.0

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

DedicatedWorkerOptions mocks base method.

func (*MockPerNSWorkerComponent) EXPECT added in v1.17.0

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

func (*MockPerNSWorkerComponent) Register added in v1.17.0

Register mocks base method.

type MockPerNSWorkerComponentMockRecorder added in v1.17.0

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

MockPerNSWorkerComponentMockRecorder is the mock recorder for MockPerNSWorkerComponent.

func (*MockPerNSWorkerComponentMockRecorder) DedicatedWorkerOptions added in v1.17.0

func (mr *MockPerNSWorkerComponentMockRecorder) DedicatedWorkerOptions(arg0 interface{}) *gomock.Call

DedicatedWorkerOptions indicates an expected call of DedicatedWorkerOptions.

func (*MockPerNSWorkerComponentMockRecorder) Register added in v1.17.0

func (mr *MockPerNSWorkerComponentMockRecorder) Register(arg0, arg1, arg2 interface{}) *gomock.Call

Register indicates an expected call of Register.

type MockWorkerComponent added in v1.17.0

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

MockWorkerComponent is a mock of WorkerComponent interface.

func NewMockWorkerComponent added in v1.17.0

func NewMockWorkerComponent(ctrl *gomock.Controller) *MockWorkerComponent

NewMockWorkerComponent creates a new mock instance.

func (*MockWorkerComponent) DedicatedActivityWorkerOptions added in v1.23.0

func (m *MockWorkerComponent) DedicatedActivityWorkerOptions() *DedicatedWorkerOptions

DedicatedActivityWorkerOptions mocks base method.

func (*MockWorkerComponent) DedicatedWorkflowWorkerOptions added in v1.23.0

func (m *MockWorkerComponent) DedicatedWorkflowWorkerOptions() *DedicatedWorkerOptions

DedicatedWorkflowWorkerOptions mocks base method.

func (*MockWorkerComponent) EXPECT added in v1.17.0

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

func (*MockWorkerComponent) RegisterActivities added in v1.23.0

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

RegisterActivities mocks base method.

func (*MockWorkerComponent) RegisterWorkflow added in v1.23.0

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

RegisterWorkflow mocks base method.

type MockWorkerComponentMockRecorder added in v1.17.0

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

MockWorkerComponentMockRecorder is the mock recorder for MockWorkerComponent.

func (*MockWorkerComponentMockRecorder) DedicatedActivityWorkerOptions added in v1.23.0

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

DedicatedActivityWorkerOptions indicates an expected call of DedicatedActivityWorkerOptions.

func (*MockWorkerComponentMockRecorder) DedicatedWorkflowWorkerOptions added in v1.23.0

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

DedicatedWorkflowWorkerOptions indicates an expected call of DedicatedWorkflowWorkerOptions.

func (*MockWorkerComponentMockRecorder) RegisterActivities added in v1.23.0

func (mr *MockWorkerComponentMockRecorder) RegisterActivities(registry interface{}) *gomock.Call

RegisterActivities indicates an expected call of RegisterActivities.

func (*MockWorkerComponentMockRecorder) RegisterWorkflow added in v1.23.0

func (mr *MockWorkerComponentMockRecorder) RegisterWorkflow(registry interface{}) *gomock.Call

RegisterWorkflow indicates an expected call of RegisterWorkflow.

type PerNSDedicatedWorkerOptions added in v1.17.0

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

type PerNSWorkerComponent added in v1.17.0

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.
	Register(sdkworker.Registry, *namespace.Namespace, RegistrationDetails)
	// DedicatedWorkerOptions returns a PerNSDedicatedWorkerOptions for this worker component.
	DedicatedWorkerOptions(*namespace.Namespace) *PerNSDedicatedWorkerOptions
}

PerNSWorkerComponent represents a per-namespace worker needed for worker role

type RegistrationDetails added in v1.20.0

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