Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TaskHandler ¶
type TaskWorkerPool ¶
type TaskWorkerPool interface { // StartWorkers Starts workers up to number numWorkers defined in config. // Should be run as a go routine. StartWorkers(ctx context.Context) // Stop Gracefully stops all workers Stop() // HeartbeatListener requeues tasks of workers whose heartbeats do not refresh within heartbeat duration HeartbeatListener() // RegisterHandler assigns a function of type TaskHandler to a typename. // This function is the action performed to tasks of typename taskType. RegisterHandler(taskType string, handler TaskHandler) }
func NewTaskWorkerPool ¶
func NewTaskWorkerPool(queue queue.Queue, metrics *m.Metrics) TaskWorkerPool
type WorkerPool ¶
type WorkerPool struct {
// contains filtered or unexported fields
}
func (*WorkerPool) HeartbeatListener ¶
func (w *WorkerPool) HeartbeatListener()
func (*WorkerPool) RegisterHandler ¶
func (w *WorkerPool) RegisterHandler(taskType string, handler TaskHandler)
func (*WorkerPool) StartWorkers ¶
func (w *WorkerPool) StartWorkers(ctx context.Context)
func (*WorkerPool) Stop ¶
func (w *WorkerPool) Stop()
Click to show internal directories.
Click to hide internal directories.