Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PanicHandler ¶
PanicHandler builds a panic handler for the worker pool that logs the panic.
Types ¶
type Payload ¶
type Payload interface {
Execute() Resultor
}
Payload encapsulates a job and its input into a neat package to be executed by another thread.
type Pool ¶
type Pool struct { *pond.WorkerPool // contains filtered or unexported fields }
and other functionality to the pool.
func (*Pool) Stop ¶
func (p *Pool) Stop()
Stop stops the pool without waiting for all workers to finish. NOTE: Tasks being executed by workers will continue until completion (unless the process is terminated). Tasks in the queue will not be executed.
func (*Pool) StopAndWait ¶
func (p *Pool) StopAndWait()
StopAndWait stops the pool and waits for all workers to finish.
type PoolConfig ¶
type PoolConfig struct { // Name is the name of the pool. Name string // PrometheusPrefix is the prefix for the prometheus metrics. PrometheusPrefix string // MinWorkers is the minimum number of workers that the resizer will // shrink the pool down to . MinWorkers uint16 // MaxWorkers is the maximum number of workers that can be active // at the same time. MaxWorkers uint16 // ResizingStrategy is the methodology used to resize the number of workers // in the pool. ResizingStrategy string // MaxQueuedJobs is the maximum number of jobs that can be queued // before the pool starts rejecting jobs. MaxQueuedJobs uint16 }
PoolConfig is the configuration for a pool.
func DefaultPoolConfig ¶
func DefaultPoolConfig() *PoolConfig
DefaultPoolConfig is the default configuration for a pool.
type TaskGroup ¶
type TaskGroup struct {
*pond.TaskGroupWithContext
}
Click to show internal directories.
Click to hide internal directories.