srvtemporal

package module
v0.0.0-...-59d8b71 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClientRequired = errors.New("client required: use WithClient to set the client")
)
View Source
var (
	ErrUnknownWorkflowPanicPolicy = errors.New("unknown workflow panic policy")
)

Functions

This section is empty.

Types

type MultiRegisterer

type MultiRegisterer []Registerer

MultiRegisterer is a Registerer that registers to multiple Registerer instances.

func (MultiRegisterer) Register

func (m MultiRegisterer) Register(workerInterface worker.Registry)

Register calls Register in sequence of all items of the slice.

type Option

type Option func(*config)

func WithBackgroundActivityContext

func WithBackgroundActivityContext(ctx context.Context) Option

func WithClient

func WithClient(client client.Client) Option

func WithInterceptors

func WithInterceptors(interceptors ...interceptor.WorkerInterceptor) Option

func WithName

func WithName(name string) Option

func WithOnFatalError

func WithOnFatalError(onFatalError func(error)) Option

func WithTaskQueue

func WithTaskQueue(taskQueue string) Option

type PlatformConfig

type PlatformConfig struct {
	MaxConcurrentActivityExecutionSize      int                 `config:"max_concurrent_activity_execution_size"`
	WorkerActivitiesPerSecond               float64             `config:"worker_activities_per_second"`
	MaxConcurrentLocalActivityExecutionSize int                 `config:"max_concurrent_local_activity_execution_size"`
	WorkerLocalActivitiesPerSecond          float64             `config:"worker_local_activities_per_second"`
	TaskQueueActivitiesPerSecond            float64             `config:"task_queue_activities_per_second"`
	MaxConcurrentActivityTaskPollers        int                 `config:"max_concurrent_activity_task_pollers"`
	MaxConcurrentWorkflowTaskExecutionSize  int                 `config:"max_concurrent_workflow_task_execution_size"`
	MaxConcurrentWorkflowTaskPollers        int                 `config:"max_concurrent_workflow_task_pollers"`
	EnableLoggingInReplay                   bool                `config:"enable_logging_in_replay"`
	StickyScheduleToStartTimeout            time.Duration       `config:"sticky_schedule_to_start_timeout"`
	WorkflowPanicPolicy                     WorkflowPanicPolicy `config:"workflow_panic_policy"`
	WorkerStopTimeout                       time.Duration       `config:"worker_stop_timeout"`
	EnableSessionWorker                     bool                `config:"enable_session_worker"`
	MaxConcurrentSessionExecutionSize       int                 `config:"max_concurrent_session_execution_size"`
	DisableWorkflowWorker                   bool                `config:"disable_workflow_worker"`
	LocalActivityWorkerOnly                 bool                `config:"local_activity_worker_only"`
	Identity                                string              `config:"identity"`
	DeadlockDetectionTimeout                time.Duration       `config:"deadlock_detection_timeout"`
	MaxHeartbeatThrottleInterval            time.Duration       `config:"max_heartbeat_throttle_interval"`
	DefaultHeartbeatThrottleInterval        time.Duration       `config:"default_heartbeat_throttle_interval"`
	DisableEagerActivities                  bool                `config:"disable_eager_activities"`
	MaxConcurrentEagerActivityExecutionSize int                 `config:"max_concurrent_eager_activity_execution_size"`
	DisableRegistrationAliasing             bool                `config:"disable_registration_aliasing"`
	BuildID                                 string              `config:"build_id"`
	UseBuildIDForVersioning                 bool                `config:"use_build_id_for_versioning"`
}

type Registerer

type Registerer interface {
	Register(worker.Registry)
}

Registerer is the entity that registers workflows and activities.

type RegistererFnc

type RegistererFnc func(worker.Registry)

RegistererFnc is a function that implements Registerer.

func (RegistererFnc) Register

func (r RegistererFnc) Register(workerInterface worker.Registry)

Register implements Registerer for a RegistererFnc.

type Worker

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

Worker is a services.Server that is able to initialize and manage the temporal Worker together with the github.com/jamillosantos/application.

func NewWorker

func NewWorker(registerer Registerer, cfg PlatformConfig, options ...Option) (Worker, error)

NewWorker implements

func (*Worker) Close

func (w *Worker) Close(_ context.Context) error

func (*Worker) Listen

func (w *Worker) Listen(_ context.Context) error

func (*Worker) Name

func (w *Worker) Name() string

type WorkflowPanicPolicy

type WorkflowPanicPolicy worker.WorkflowPanicPolicy

func (*WorkflowPanicPolicy) UnmarshalText

func (w *WorkflowPanicPolicy) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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