Help us shape the future of Go! Take the 2026 Go Developer Survey

worker

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityTaskWorker

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

func (*ActivityTaskWorker) Complete

func (atw *ActivityTaskWorker) Complete(ctx context.Context, result *history.Event, task *backend.ActivityTask) error

func (*ActivityTaskWorker) Execute

func (*ActivityTaskWorker) Extend

func (atw *ActivityTaskWorker) Extend(ctx context.Context, task *backend.ActivityTask) error

func (*ActivityTaskWorker) Get

func (*ActivityTaskWorker) Start

func (atw *ActivityTaskWorker) Start(ctx context.Context, queues []workflow.Queue) error

type TaskWorker

type TaskWorker[Task, Result any] interface {
	Start(context.Context, []workflow.Queue) error
	Get(context.Context, []workflow.Queue) (*Task, error)
	Extend(context.Context, *Task) error
	Execute(context.Context, *Task) (*Result, error)
	Complete(context.Context, *Result, *Task) error
}

type Worker

type Worker[Task, TaskResult any] struct {
	// contains filtered or unexported fields
}

func NewActivityWorker

func NewActivityWorker(
	b backend.Backend,
	registry *registry.Registry,
	clock clock.Clock,
	options WorkerOptions,
) *Worker[backend.ActivityTask, history.Event]

func NewWorker

func NewWorker[Task, TaskResult any](
	b backend.Backend, tw TaskWorker[Task, TaskResult], options *WorkerOptions,
) *Worker[Task, TaskResult]

func (*Worker[Task, TaskResult]) Start

func (w *Worker[Task, TaskResult]) Start(ctx context.Context) error

func (*Worker[Task, TaskResult]) WaitForCompletion

func (w *Worker[Task, TaskResult]) WaitForCompletion() error

type WorkerOptions

type WorkerOptions struct {
	Pollers int

	MaxParallelTasks int

	HeartbeatInterval time.Duration

	PollingInterval time.Duration

	Queues []workflow.Queue
}

type WorkflowTaskWorker

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

func (*WorkflowTaskWorker) Complete

Complete implements TaskWorker.

func (*WorkflowTaskWorker) Execute

func (*WorkflowTaskWorker) Extend

func (*WorkflowTaskWorker) Get

func (*WorkflowTaskWorker) Start

func (wtw *WorkflowTaskWorker) Start(ctx context.Context, queues []workflow.Queue) error

type WorkflowWorkerOptions

type WorkflowWorkerOptions struct {
	WorkerOptions

	WorkflowExecutorCache     executor.Cache
	WorkflowExecutorCacheSize int
	WorkflowExecutorCacheTTL  time.Duration
}

Jump to

Keyboard shortcuts

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