Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct { Context context.Context Duration time.Duration Handler func(context.Context, *map[string]interface{}) error HandlerArgs *map[string]interface{} }
Job contains all of the information for a worker to execute the job. A job contains a context and a duration. The job handler is provided a new context for the job based off or the job's provided context and the given duration.
type Workers ¶
type Workers struct {
// contains filtered or unexported fields
}
Workers handles the provided number of workers and allows jobs to be sent to the workers and distributes those jobs to the workers.
func (*Workers) Add ¶
Add takes a Job as an argument and sends that job to the workers to be executed when a worker is available.
Click to show internal directories.
Click to hide internal directories.