Documentation ¶
Index ¶
- Constants
- func TaskRunPeriodic(f func() time.Duration, task_name string, defaultInterval time.Duration)
- type WorkQueue
- type WorkRequest
- type Worker
- type WorkersPool
- func (wp *WorkersPool) Collect(f func(interface{}) interface{}, params interface{}, delay time.Duration) error
- func (wp *WorkersPool) CollectWithOutput(f func(interface{}) interface{}, params interface{}, delay time.Duration, ...) error
- func (wp *WorkersPool) IsEmpty() bool
- func (wp *WorkersPool) IsFull() bool
- func (wp *WorkersPool) Start(nWorkers int, maxBuffer int)
- func (wp *WorkersPool) Stop()
Constants ¶
View Source
const ( WorkerStateIdle = 0 WorkerStateBusy = 1 WorkerStateQuit = 2 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type WorkRequest ¶
type WorkRequest struct {
// contains filtered or unexported fields
}
type Worker ¶
type Worker struct { ID int Work *WorkQueue Status int Quit chan bool // contains filtered or unexported fields }
func (*Worker) IsAvailable ¶
func (*Worker) Unavailable ¶
func (w *Worker) Unavailable()
type WorkersPool ¶
type WorkersPool struct { container.Queue Quit chan bool // contains filtered or unexported fields }
func (*WorkersPool) Collect ¶
func (wp *WorkersPool) Collect(f func(interface{}) interface{}, params interface{}, delay time.Duration) error
func (*WorkersPool) CollectWithOutput ¶
func (wp *WorkersPool) CollectWithOutput(f func(interface{}) interface{}, params interface{}, delay time.Duration, output chan interface{}) error
func (*WorkersPool) IsEmpty ¶
func (wp *WorkersPool) IsEmpty() bool
func (*WorkersPool) IsFull ¶
func (wp *WorkersPool) IsFull() bool
func (*WorkersPool) Start ¶
func (wp *WorkersPool) Start(nWorkers int, maxBuffer int)
func (*WorkersPool) Stop ¶
func (wp *WorkersPool) Stop()
Click to show internal directories.
Click to hide internal directories.