Documentation
¶
Index ¶
- type JobEventCallback
- type MetricsCallback
- type Pool
- func (p *Pool) CancelJob(ctx context.Context, jobID string) error
- func (p *Pool) GetStatus(ctx context.Context) *domain.WorkerStatus
- func (p *Pool) SetJobEventCallback(callback JobEventCallback)
- func (p *Pool) SetLogRetention(days int)
- func (p *Pool) SetMetricsCallback(callback MetricsCallback)
- func (p *Pool) Start(ctx context.Context) error
- func (p *Pool) Stop(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JobEventCallback ¶ added in v1.1.0
type JobEventCallback func(ctx context.Context, event domain.WebhookEvent)
JobEventCallback is called when a job event occurs
type MetricsCallback ¶ added in v1.1.0
MetricsCallback is called to report job metrics
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool manages a pool of workers for executing jobs
func NewPool ¶
func NewPool(workers int, repo repository.Repository, registry *domain.JobRegistry) *Pool
NewPool creates a new worker pool
func (*Pool) GetStatus ¶
func (p *Pool) GetStatus(ctx context.Context) *domain.WorkerStatus
GetStatus returns the current status of the worker pool
func (*Pool) SetJobEventCallback ¶ added in v1.1.0
func (p *Pool) SetJobEventCallback(callback JobEventCallback)
SetJobEventCallback sets the callback for job events (used for webhooks)
func (*Pool) SetLogRetention ¶ added in v1.1.0
SetLogRetention configures log retention cleanup
func (*Pool) SetMetricsCallback ¶ added in v1.1.0
func (p *Pool) SetMetricsCallback(callback MetricsCallback)
SetMetricsCallback sets the callback for job metrics
Click to show internal directories.
Click to hide internal directories.