Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultExecutor ¶
type DefaultExecutor struct {
// contains filtered or unexported fields
}
DefaultExecutor is our concrete implementation of JobExecutor
func NewExecutor ¶
func NewExecutor(handlers map[string]JobHandler) *DefaultExecutor
NewExecutor creates an executor with the given handlers. If handlers is nil, an empty map will be initialized for the registry.
func (*DefaultExecutor) Register ¶
func (e *DefaultExecutor) Register(jobType string, handler JobHandler)
Register adds a new handler for a specific job type. It overwrites any existing handler for the same job type.
type JobExecutor ¶
type JobExecutor interface {
Execute(ctx context.Context, job db.Job) error // Changed to db.Job
Register(jobType string, handler JobHandler)
}
JobExecutor defines the interface for executing jobs and registering handlers.
Click to show internal directories.
Click to hide internal directories.