Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MaxWorker = runtime.NumCPU() MaxQueue = 100 )
View Source
var JobQueue chan Job
A buffered channel that we can send work requests on.
Functions ¶
func WorkTest ¶
func WorkTest(params IJobParams) error
Types ¶
type Dispatcher ¶
type Dispatcher struct { WorkerPool chan chan Job // contains filtered or unexported fields }
func NewDispatcher ¶
func NewDispatcher(maxWorkers int) *Dispatcher
func (*Dispatcher) Run ¶
func (d *Dispatcher) Run()
type Job ¶
type Job struct { Payload func(IJobParams) error Data *JobParams }
Job represents the job to be run
type Worker ¶
type Worker struct { WorkerPool chan chan Job JobChannel chan Job // contains filtered or unexported fields }
Worker represents the worker that executes the job
Click to show internal directories.
Click to hide internal directories.