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 ¶
- type NamedFunctiondeprecated
- type Workerdeprecated
- type WorkerImpldeprecated
- func (w *WorkerImpl) IsPaused(ctx context.Context) (bool, error)
- func (w *WorkerImpl) Pause(ctx context.Context) error
- func (w *WorkerImpl) RegisterWorkflows(workflows ...workflow.WorkflowBase) error
- func (w *WorkerImpl) Start() (func() error, error)
- func (w *WorkerImpl) StartBlocking(ctx context.Context) error
- func (w *WorkerImpl) Unpause(ctx context.Context) error
- type WorkerLabelsdeprecated
- type WorkerOptsdeprecated
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 all worker instances are paused
IsPaused(ctx context.Context) (bool, error)
// Pause pauses all worker instances
Pause(ctx context.Context) error
// Unpause resumes all paused worker instances
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 ¶
func (w *WorkerImpl) IsPaused(ctx context.Context) (bool, error)
IsPaused checks if all worker instances are paused
func (*WorkerImpl) Pause ¶
func (w *WorkerImpl) Pause(ctx context.Context) error
Pause pauses all worker instances
func (*WorkerImpl) RegisterWorkflows ¶
func (w *WorkerImpl) RegisterWorkflows(workflows ...workflow.WorkflowBase) error
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 ¶
func (w *WorkerImpl) Start() (func() error, error)
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 ¶
func (w *WorkerImpl) StartBlocking(ctx context.Context) error
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.
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