matching

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2017 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrNoTasks is exported temporarily for integration test
	ErrNoTasks = errors.New("No tasks")
)

Functions

func NewService

func NewService(params *service.BootstrapParams, config *Config) common.Daemon

NewService builds a new cadence-matching service

Types

type Config added in v0.3.0

type Config struct {
	EnableSyncMatch bool
	// Time to hold a poll request before returning an empty response if there are no tasks
	LongPollExpirationInterval time.Duration

	// taskListManager configuration
	RangeSize         int64
	GetTasksBatchSize int
	UpdateAckInterval time.Duration

	// taskWriter configuration
	OutstandingTaskAppendsThreshold int
	MaxTaskBatchSize                int
}

Config represents configuration for cadence-matching service

func NewConfig added in v0.3.0

func NewConfig() *Config

NewConfig returns new service config with default values

type Engine

type Engine interface {
	Stop()
	AddDecisionTask(addRequest *m.AddDecisionTaskRequest) error
	AddActivityTask(addRequest *m.AddActivityTaskRequest) error
	PollForDecisionTask(ctx context.Context, request *m.PollForDecisionTaskRequest) (*m.PollForDecisionTaskResponse, error)
	PollForActivityTask(ctx context.Context, request *m.PollForActivityTaskRequest) (*workflow.PollForActivityTaskResponse, error)
	QueryWorkflow(ctx context.Context, request *m.QueryWorkflowRequest) (*workflow.QueryWorkflowResponse, error)
	RespondQueryTaskCompleted(ctx context.Context, request *m.RespondQueryTaskCompletedRequest) error
	CancelOutstandingPoll(ctx context.Context, request *m.CancelOutstandingPollRequest) error
}

Engine exposes interfaces for clients to poll for activity and decision tasks.

func NewEngine

func NewEngine(taskManager persistence.TaskManager,
	historyService history.Client,
	config *Config,
	logger bark.Logger,
	metricsClient metrics.Client) Engine

NewEngine creates an instance of matching engine

type Handler

type Handler struct {
	service.Service
	// contains filtered or unexported fields
}

Handler - Thrift handler inteface for history service

func NewHandler

func NewHandler(sVice service.Service, config *Config, taskPersistence persistence.TaskManager) *Handler

NewHandler creates a thrift handler for the history service

func (*Handler) AddActivityTask

func (h *Handler) AddActivityTask(ctx context.Context, addRequest *m.AddActivityTaskRequest) error

AddActivityTask - adds an activity task.

func (*Handler) AddDecisionTask

func (h *Handler) AddDecisionTask(ctx context.Context, addRequest *m.AddDecisionTaskRequest) error

AddDecisionTask - adds a decision task.

func (*Handler) CancelOutstandingPoll added in v0.3.2

func (h *Handler) CancelOutstandingPoll(ctx context.Context,
	request *m.CancelOutstandingPollRequest) error

CancelOutstandingPoll is used to cancel outstanding pollers

func (*Handler) Health added in v0.3.0

func (h *Handler) Health(ctx context.Context) (*health.HealthStatus, error)

Health is for health check

func (*Handler) PollForActivityTask

func (h *Handler) PollForActivityTask(ctx context.Context,
	pollRequest *m.PollForActivityTaskRequest) (*gen.PollForActivityTaskResponse, error)

PollForActivityTask - long poll for an activity task.

func (*Handler) PollForDecisionTask

func (h *Handler) PollForDecisionTask(ctx context.Context,
	pollRequest *m.PollForDecisionTaskRequest) (*m.PollForDecisionTaskResponse, error)

PollForDecisionTask - long poll for a decision task.

func (*Handler) QueryWorkflow added in v0.3.2

func (h *Handler) QueryWorkflow(ctx context.Context,
	queryRequest *m.QueryWorkflowRequest) (*gen.QueryWorkflowResponse, error)

QueryWorkflow queries a given workflow synchronously and return the query result.

func (*Handler) RespondQueryTaskCompleted added in v0.3.2

func (h *Handler) RespondQueryTaskCompleted(ctx context.Context, request *m.RespondQueryTaskCompletedRequest) error

RespondQueryTaskCompleted responds a query task completed

func (*Handler) Start

func (h *Handler) Start() error

Start starts the handler

func (*Handler) Stop

func (h *Handler) Stop()

Stop stops the handler

type Service

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

Service represents the cadence-matching service

func (*Service) Start

func (s *Service) Start()

Start starts the service

func (*Service) Stop

func (s *Service) Stop()

Stop stops the service

Jump to

Keyboard shortcuts

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