Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrJobNotFound = errors.New("job not found") ErrToLate = errors.New("too late") )
Functions ¶
func StartExecutionPool ¶
func StartExecutionPool(ctx context.Context, dispatchQueue DispatchQueue, options ExecutorOptions)
StartExecutionPool starts executor pool, it can be closed by cancelling the passed context This needs to be run in a seperate go-routine
Types ¶
type DispatchQueue ¶
type Executor ¶
type Executor interface { // Run adds the job to the execution queue. // Internally it is added in a time.After function Run(job jm.Job) error // Update updates the job details after the job is queued. // If the job is not queued, it will return ErrJobNotFound Update(job jm.Job) error // Delete deletes the queued job. // If the job is not queued, it will return ErrJobNotFound Delete(jobID string) error DispatchQueue }
Executor queues the jobs and runs them one by one. It also includes methods to delete or update the job so that you can change the job state when it is queued in the memory.
func NewExecutor ¶
func NewExecutor() Executor
Click to show internal directories.
Click to hide internal directories.