Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
type Dispatcher interface {
Dispatch(task Task)
}
type DispatcherImpl ¶
type DispatcherImpl struct {
sync.Mutex
// A pool of workers channels that are registered with the dispatcher
WorkerPool chan chan Task
// contains filtered or unexported fields
}
func NewDispatcher ¶
func NewDispatcher(maxWorkers int, targetQueue chan Task) *DispatcherImpl
func (*DispatcherImpl) Dispatch ¶
func (d *DispatcherImpl) Dispatch(job Task)
func (*DispatcherImpl) Run ¶
func (d *DispatcherImpl) Run() error
func (*DispatcherImpl) Stop ¶
func (d *DispatcherImpl) Stop() error
type Worker ¶
type Worker struct {
WorkerPool chan chan Task
JobChannel chan Task
// contains filtered or unexported fields
}
Worker represents the worker that executes the job
Click to show internal directories.
Click to hide internal directories.