Documentation
¶
Index ¶
- type Dispatcher
- func (d *Dispatcher) Add(job func() error)
- func (d *Dispatcher) DownScale(workerCount int) *Dispatcher
- func (d *Dispatcher) Finish() <-chan struct{}
- func (d *Dispatcher) GetWorkerCount() int
- func (d *Dispatcher) JobError() <-chan error
- func (d *Dispatcher) Start() *Dispatcher
- func (d *Dispatcher) StartJobObserver()
- func (d *Dispatcher) Stop() *Dispatcher
- func (d *Dispatcher) UpScale(workerCount int) *Dispatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
Dispatcher managements worker
func NewDispatcher ¶
func NewDispatcher(workerCount int) *Dispatcher
NewDispatcher returns Dispatcher object
func (*Dispatcher) DownScale ¶
func (d *Dispatcher) DownScale(workerCount int) *Dispatcher
DownScale scales down the numer of worker
func (*Dispatcher) Finish ¶
func (d *Dispatcher) Finish() <-chan struct{}
Finish notifies when all jobs are finished
func (*Dispatcher) GetWorkerCount ¶
func (d *Dispatcher) GetWorkerCount() int
GetWorkerCount returns the number of workers
func (*Dispatcher) JobError ¶
func (d *Dispatcher) JobError() <-chan error
JobError returns error of job
func (*Dispatcher) StartJobObserver ¶
func (d *Dispatcher) StartJobObserver()
StartJobObserver monitors jobs. Then, when all the jobs are completed, the notification is transmitted
func (*Dispatcher) UpScale ¶
func (d *Dispatcher) UpScale(workerCount int) *Dispatcher
UpScale scales up the numer of worker
Click to show internal directories.
Click to hide internal directories.