worker

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2019 License: MIT Imports: 15 Imported by: 4

README

Cadence Worker

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

Replicator

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

It uses Kafka as the replication tasks buffer and relies on [kafka-client library] (https://github.com/uber-go/kafka-client/) for consuming messages from Kafka.

Quickstart for localhost development

  1. Setup Kafka by following instructions: Kafka Quickstart
  2. Create Kafka topic for active cluster:
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic active
  1. Create Kafka topic for standby cluster:
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic standby
  1. Start Cadence development server for active zone:
./cadence-server --zone active start

Cadence cluster is now running with the replicator consuming messages from Kafka topic standby.

Create replication task using CLI

Kafka CLI can be used to generate a replication task for testing purpose:

bin/kafka-console-producer.sh --broker-list localhost:9092 --topic standby

Replication task message:

{taskType: 0}

SysWorkflow

SysWorker is a background worker responsible for running arbitrary system workflows. Initiator is used to send signals of various types to hosted system workflow code. These signals are then handled by an activity. The first supported system activity will be archival but, these system workflows can be used for any type of system task.

Documentation

Index

Constants

View Source
const (
	// FrontendRetryLimit is the number of times frontend will try to be connected to before giving up
	FrontendRetryLimit = 5

	// PollingDelay is the amount of time to wait between polling frontend
	PollingDelay = time.Second
)

Variables

This section is empty.

Functions

func NewService

func NewService(params *service.BootstrapParams) common.Daemon

NewService builds a new cadence-worker service

Types

type Config

type Config struct {
	ReplicationCfg *replicator.Config
	SysWorkflowCfg *sysworkflow.Config
}

Config contains all the service config for worker

func NewConfig

func NewConfig(dc *dynamicconfig.Collection) *Config

NewConfig builds the new Config for cadence-worker service

type Service

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

Service represents the cadence-worker service. This service host all background processing which needs to happen for a Cadence cluster. This service runs the replicator which is responsible for applying replication tasks generated by remote clusters.

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

Jump to

Keyboard shortcuts

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