processor

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// WorkerCount is the number of workers processing tasks
	WorkerCount int

	// MaxTaskRetries is the maximum number of retries for a task
	MaxTaskRetries int

	// RetryDelay is the delay between task retry attempts
	RetryDelay time.Duration
}

Config represents executor service configuration

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default executor configuration

type Option

type Option func(*Service)

Package executor provides a service executor.

func WithConfig

func WithConfig(config Config) Option

WithConfig sets the configuration for the service

func WithExecutor

func WithExecutor(executor executor.Service) Option

WithExecutor sets the task executor for the service

func WithMessageQueue

func WithMessageQueue(queue messaging.Queue[execution.Execution]) Option

WithMessageQueue sets the message queue implementation

func WithProcessDAO

func WithProcessDAO(processDAO dao.Service[string, execution.Process]) Option

WithProcessDAO sets the process store implementation

func WithTaskExecutionDAO

func WithTaskExecutionDAO(taskExecutionDao dao.Service[string, execution.Execution]) Option

func WithTaskExecutor

func WithTaskExecutor(executor executor.Service) Option

WithTaskExecutor sets a custom task executor function

func WithWorkers

func WithWorkers(count int) Option

WithWorkers sets the number of worker goroutines

type Service

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

Service handles workflow execution

func New

func New(options ...Option) (*Service, error)

New creates a new executor service

func (*Service) GetProcess

func (s *Service) GetProcess(ctx context.Context, processID string) (*execution.Process, error)

GetProcess retrieves a process by ID

func (*Service) PauseProcess

func (s *Service) PauseProcess(ctx context.Context, processID string) error

PauseProcess pauses a running process

func (*Service) ResumeProcess

func (s *Service) ResumeProcess(ctx context.Context, processID string) error

ResumeProcess resumes a paused process

func (*Service) Shutdown

func (s *Service) Shutdown()

Shutdown stops the executor service

func (*Service) Start

func (s *Service) Start(ctx context.Context) error

Start begins the task execution service

func (*Service) StartProcess

func (s *Service) StartProcess(ctx context.Context, workflow *model.Workflow, init map[string]interface{}, customTasks ...string) (aProcess *execution.Process, err error)

StartProcess begins execution of a workflow

Jump to

Keyboard shortcuts

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