worker

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: MIT Imports: 35 Imported by: 0

README

Temporal Worker

Temporal Worker is a role for Temporal service used for hosting any components responsible for performing background processing on the Temporal cluster.

Replicator

Replicator is a background worker responsible for consuming replication tasks generated by remote Temporal clusters and pass it down to processor, so they can be applied to local Temporal cluster.

Quickstart for localhost development
  1. Start Temporal development server for active zone:

    ./temporal-server --zone active start
    
  2. Start Temporal development server for standby(passive) zone:

    ./temporal-server --zone standby start
    
  3. Create global namespaces

    tctl --ns sample namespace register --gd true --ac active --cl active standby
    
  4. Failover between zones:

    Failover to standby:

    tctl --ns sample namespace update --ac standby
    

    Failback to active:

    tctl --ns sample namespace update --ac active
    

Archiver

Archiver is used to handle archival of workflow execution histories. It does this by hosting a Temporal client worker and running an archival system workflow. The archival client gets used to initiate archival through signal sending. The archiver shards work across several workflows.

Documentation

Index

Constants

View Source
const DefaultWorkerTaskQueue = "default-worker-tq"

Variables

Functions

func NewWorkerManager added in v1.14.0

func NewWorkerManager(params initParams) *workerManager

func ParamsExpandProvider added in v1.13.0

func ParamsExpandProvider(params *resource.BootstrapParams) common.RPCFactory

func PersistenceMaxQpsProvider added in v1.13.0

func PersistenceMaxQpsProvider(
	serviceConfig *Config,
) persistenceClient.PersistenceMaxQps

func ServiceLifetimeHooks added in v1.13.0

func ServiceLifetimeHooks(
	lc fx.Lifecycle,
	svcStoppedCh chan struct{},
	svc *Service,
)

func ThrottledLoggerRpsFnProvider added in v1.13.0

func ThrottledLoggerRpsFnProvider(serviceConfig *Config) resource.ThrottledLoggerRpsFn

Types

type Config

type Config struct {
	ArchiverConfig                *archiver.Config
	ScannerCfg                    *scanner.Config
	ParentCloseCfg                *parentclosepolicy.Config
	BatcherCfg                    *batcher.Config
	ThrottledLogRPS               dynamicconfig.IntPropertyFn
	PersistenceMaxQPS             dynamicconfig.IntPropertyFn
	PersistenceGlobalMaxQPS       dynamicconfig.IntPropertyFn
	EnableBatcher                 dynamicconfig.BoolPropertyFn
	EnableParentClosePolicyWorker dynamicconfig.BoolPropertyFn
}

Config contains all the service config for worker

func NewConfig

func NewConfig(logger log.Logger, dcClient dynamicconfig.Client, params *resource.BootstrapParams) *Config

NewConfig builds the new Config for worker service

type Service

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

Service represents the temporal-worker service. This service hosts all background processing needed for temporal cluster: Replicator: Handles applying replication tasks generated by remote clusters. Archiver: Handles archival of workflow histories.

func NewService

func NewService(
	logger resource.SnTaggedLogger,
	serviceConfig *Config,
	sdkClientFactory sdk.ClientFactory,
	sdkSystemClient sdkclient.Client,
	esClient esclient.Client,
	archivalMetadata carchiver.ArchivalMetadata,
	clusterMetadata cluster.Metadata,
	metricsClient metrics.Client,
	clientBean client.Bean,
	clusterMetadataManager persistence.ClusterMetadataManager,
	namespaceRegistry namespace.Registry,
	executionManager persistence.ExecutionManager,
	archiverProvider provider.ArchiverProvider,
	persistenceBean persistenceClient.Bean,
	membershipMonitor membership.Monitor,
	namespaceReplicationQueue persistence.NamespaceReplicationQueue,
	metricsScope tally.Scope,
	metadataManager persistence.MetadataManager,
	taskManager persistence.TaskManager,
	historyClient historyservice.HistoryServiceClient,
	manager *workerManager,
) (*Service, error)

func (*Service) Start

func (s *Service) Start()

Start is called to start the service

func (*Service) Stop

func (s *Service) Stop()

Stop is called to stop the service

Directories

Path Synopsis
Package archiver is a generated GoMock package.
Package archiver is a generated GoMock package.
Package parentclosepolicy is a generated GoMock package.
Package parentclosepolicy is a generated GoMock package.

Jump to

Keyboard shortcuts

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