Documentation ¶
Overview ¶
Package workerpool implements the design pattern for worker pool
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct {
// contains filtered or unexported fields
}
Job Structure that wraps Jobs information
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Manager generic struct that keeps all the logic to manage the queues
func (*Pool) IsCompleted ¶
IsCompleted utility method to check if all work has done from an outside caller.
func (*Pool) Start ¶
func (m *Pool) Start(resources []interface{}, procFunc ProcessorFunc, resFunc ResultProcessorFunc)
type ProcessorFunc ¶
type ProcessorFunc func(resource interface{}) error
ProcessorFunc signature that defines the dependency injection to process "Jobs"
type ResultProcessorFunc ¶
ResultProcessorFunc signature that defines the dependency injection to process "Results"
Click to show internal directories.
Click to hide internal directories.