Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WorkerFunc ¶
type WorkerFunc func(workerID int, jobData interface{})
WorkerFunc is a function to perform a single worker job.
type WorkerPool ¶
type WorkerPool struct {
// contains filtered or unexported fields
}
WorkerPool is a structure to run a pool of worker goroutines, gracefully handling interrupt and termination signals.
func (*WorkerPool) PublishJobData ¶
func (wp *WorkerPool) PublishJobData(jobData interface{})
PublishJobData adds some data to be processed by the workers.
func (*WorkerPool) Run ¶
func (wp *WorkerPool) Run(workerFunc WorkerFunc)
Run runs all workers and blocks until a signal is received.
Click to show internal directories.
Click to hide internal directories.