Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var JobQueue chan JobInterface
A buffered channel that we can send work requests on.
Functions ¶
func SubmitJob ¶
func SubmitJob(job JobInterface)
Types ¶
type Dispatcher ¶
type Dispatcher struct { // A pool of workers channels that are registered with the dispatcher WorkerPool chan chan JobInterface // contains filtered or unexported fields }
func NewDispatcher ¶
func NewDispatcher(maxWorkers int) *Dispatcher
func (*Dispatcher) Run ¶
func (d *Dispatcher) Run()
type GoroutineResponse ¶
type JobInterface ¶
type JobInterface interface {
Run() error
}
type Worker ¶
type Worker struct { WorkerPool chan chan JobInterface JobChannel chan JobInterface // contains filtered or unexported fields }
Worker represents the worker that executes the job
func NewWorker ¶
func NewWorker(workerPool chan chan JobInterface) Worker
Click to show internal directories.
Click to hide internal directories.