dispatcher

package
v0.1.0-debug.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2025 License: MIT Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const HeartbeatInterval = 4 * time.Second

Variables

View Source
var ErrWorkerNotFound = fmt.Errorf("worker not found")

Functions

func UnmarshalPayload

func UnmarshalPayload[T any](payload interface{}) (T, error)

Types

type Dispatcher

type Dispatcher interface {
	contracts.DispatcherServer
	Start() (func() error, error)
}

type DispatcherImpl

type DispatcherImpl struct {
	contracts.UnimplementedDispatcherServer
	// contains filtered or unexported fields
}

func New

func New(fs ...DispatcherOpt) (*DispatcherImpl, error)

func (*DispatcherImpl) Heartbeat

Heartbeat is used to update the last heartbeat time for a worker

func (*DispatcherImpl) Listen

Subscribe handles a subscribe request from a client

func (*DispatcherImpl) ListenV2

ListenV2 is like Listen, but implementation does not include heartbeats. This should only used by SDKs against engine version v0.18.1+

func (*DispatcherImpl) PutOverridesData

func (*DispatcherImpl) RefreshTimeout

func (*DispatcherImpl) Register

func (*DispatcherImpl) ReleaseSlot

func (*DispatcherImpl) SendGroupKeyActionEvent

func (s *DispatcherImpl) SendGroupKeyActionEvent(ctx context.Context, request *contracts.GroupKeyActionEvent) (*contracts.ActionEventResponse, error)

func (*DispatcherImpl) SendStepActionEvent

func (s *DispatcherImpl) SendStepActionEvent(ctx context.Context, request *contracts.StepActionEvent) (*contracts.ActionEventResponse, error)

func (*DispatcherImpl) Start

func (d *DispatcherImpl) Start() (func() error, error)

func (*DispatcherImpl) SubscribeToWorkflowRuns

func (s *DispatcherImpl) SubscribeToWorkflowRuns(server contracts.Dispatcher_SubscribeToWorkflowRunsServer) error

func (*DispatcherImpl) UpsertWorkerLabels

type DispatcherOpt

type DispatcherOpt func(*DispatcherOpts)

func WithAlerter

func WithAlerter(a hatcheterrors.Alerter) DispatcherOpt

func WithCache

func WithCache(cache cache.Cacheable) DispatcherOpt

func WithDispatcherId

func WithDispatcherId(dispatcherId string) DispatcherOpt

func WithLogger

func WithLogger(l *zerolog.Logger) DispatcherOpt

func WithMessageQueue

func WithMessageQueue(mq msgqueue.MessageQueue) DispatcherOpt

func WithMessageQueueV1

func WithMessageQueueV1(mqv1 msgqueuev1.MessageQueue) DispatcherOpt

func WithRepositoryV1

func WithRepositoryV1(r v1.Repository) DispatcherOpt

type DispatcherOpts

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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