Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Factories = make(map[string]WorkerFactory) WORKER_NOT_EXIST = errors.New("worker: worker type does not exist") )
Factories holds all of the WorkerFacories that will be loaded for the manager to use
Functions ¶
func LoadWorker ¶
func LoadWorker(w WorkerFactory)
LoadWorker loads a worker into the map of workers
Types ¶
type Worker ¶
type Worker interface { // Work will be called by the manager to start the worker Work(j job.Job) *job.JobStats // Recycle get the worker ready to take on more work Recycle() // Kill send the kill signal to the worker Kill() error config.Configer }
Worker is used by a Manager to control the work being done by a sub-process
type WorkerFactory ¶
type WorkerFactory func() Worker
WorkerFactory constructs and returns a new worker
Click to show internal directories.
Click to hide internal directories.