Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(opt *PoolOption)
Option func type which adjust option values
func WithMaxTasksCount ¶
WithMaxTasksCount defines maximum amount of tasks prepared for execution
func WithRecoverHandler ¶
func WithRecoverHandler(f func(interface{})) Option
WithRecoverHandler defined error handler
func WithWorkerCount ¶
WithWorkerCount change count of workers
func WithWorkerPoolSize ¶
WithWorkerPoolSize setup maximal size of worker pool
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool provides common queue of tasks execution
func NewSinglePool ¶
NewSinglePool for one task simultaneusly processing
type PoolFunc ¶
type PoolFunc struct {
// contains filtered or unexported fields
}
PoolFunc concurrent async processor with single handler
func NewPoolFunc ¶
NewPoolFunc returns function pool
func NewSinglePoolFunc ¶
NewSinglePoolFunc returns function pool one task simultaneusly processing
type PoolOption ¶
type PoolOption struct {
WorkerCount int
WorkerPoolSize int
MaxTasksCount int
RecoverHandler func(interface{})
}
PoolOption contains options of the pool
func (*PoolOption) PreparedWorkerCount ¶
func (opt *PoolOption) PreparedWorkerCount() int
PreparedWorkerCount returns maximum count ow workers or Num of CPU
func (*PoolOption) TaskQueueSize ¶
func (opt *PoolOption) TaskQueueSize() int
TaskQueueSize returns the common pool size for all workers