worker

package
v0.78.26-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 7 Imported by: 4

Documentation

Overview

Deprecated: This package is part of the old generics-based v1 Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NamedFunction deprecated

type NamedFunction struct {
	ActionID string
	Fn       workflow.WrappedTaskFn
}

Deprecated: NamedFunction is part of the old generics-based v1 Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

type Worker deprecated

type Worker interface {
	// Start begins worker execution in a non-blocking manner and returns a cleanup function.
	// the cleanup function should be called when the worker needs to be stopped.
	Start() (func() error, error)

	// StartBlocking begins worker execution and blocks until the process is interrupted.
	StartBlocking(ctx context.Context) error

	// RegisterWorkflows registers one or more workflows with the worker.
	RegisterWorkflows(workflows ...workflow.WorkflowBase) error

	// IsPaused checks if the worker is paused
	IsPaused(ctx context.Context) (bool, error)

	// Pause pauses the worker
	Pause(ctx context.Context) error

	// Unpause resumes the paused worker
	Unpause(ctx context.Context) error
}

Deprecated: Worker is part of the old generics-based v1 Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func NewWorker deprecated

func NewWorker(workersClient features.WorkersClient, v0 v0Client.Client, opts WorkerOpts) (Worker, error)

Deprecated: NewWorker is part of the old generics-based v1 Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

type WorkerImpl deprecated

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

Deprecated: WorkerImpl is part of the old generics-based v1 Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

func (*WorkerImpl) IsPaused deprecated

func (w *WorkerImpl) IsPaused(ctx context.Context) (bool, error)

Deprecated: IsPaused is part of the old generics-based v1 Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

IsPaused checks if all worker instances are paused

func (*WorkerImpl) Pause deprecated

func (w *WorkerImpl) Pause(ctx context.Context) error

Deprecated: Pause is part of the old generics-based v1 Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

Pause pauses all worker instances

func (*WorkerImpl) RegisterWorkflows deprecated

func (w *WorkerImpl) RegisterWorkflows(workflows ...workflow.WorkflowBase) error

Deprecated: RegisterWorkflows is part of the old generics-based v1 Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

RegisterWorkflows registers one or more workflows with the worker. it converts the workflows to the format expected by the underlying worker implementation and registers both the workflow definitions and their action functions. returns an error if registration fails.

func (*WorkerImpl) Start deprecated

func (w *WorkerImpl) Start() (func() error, error)

Deprecated: Start is part of the old generics-based v1 Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

Start begins worker execution in a non-blocking manner. returns a cleanup function to be called when the worker should be stopped, and any error encountered during startup.

func (*WorkerImpl) StartBlocking deprecated

func (w *WorkerImpl) StartBlocking(ctx context.Context) error

Deprecated: StartBlocking is part of the old generics-based v1 Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

StartBlocking begins worker execution and blocks until the process is interrupted. this method handles graceful shutdown via interrupt signals. returns any error encountered during startup or shutdown.

func (*WorkerImpl) Unpause deprecated

func (w *WorkerImpl) Unpause(ctx context.Context) error

Deprecated: Unpause is part of the old generics-based v1 Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

Unpause resumes all paused worker instances

type WorkerLabels deprecated

type WorkerLabels map[string]interface{}

Deprecated: WorkerLabels is part of the old generics-based v1 Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

type WorkerOpts deprecated

type WorkerOpts struct {
	// (required) the friendly name of the worker
	Name string

	// (optional) a list of workflows to register on the worker. If not provided, the worker will not run any workflows.
	Workflows []workflow.WorkflowBase

	// (optional) maximum number of concurrent runs on this worker, defaults to 100
	Slots int

	// (optional) labels to set on the worker
	Labels WorkerLabels

	// (optional) logger to use for the worker
	Logger *zerolog.Logger

	// (optional) log level
	LogLevel string

	// (optional) maximum number of concurrent runs for durable tasks, defaults to 1000
	DurableSlots int
}

Deprecated: WorkerOpts is part of the old generics-based v1 Go SDK. Use the new Go SDK at github.com/hatchet-dev/hatchet/sdks/go instead. Migration guide: https://docs.hatchet.run/home/migration-guide-go

Jump to

Keyboard shortcuts

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