package
Version:
v0.8.3
Opens a new window with list of versions in this module.
Published: Feb 26, 2018
License: BSD-2-Clause
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package worker implements a worker pool.
Func does the actual work within a Pool.
type Job struct {
Data interface{}
Result interface{}
Error error
}
Job is one unit of work. It is given to a Func, and the returned result and
error are stored in Result and Error.
Pool implements a worker pool.
New returns a new worker pool with n goroutines, each running the function
f. The workers are started immediately.
Wait waits for all worker goroutines to terminate, afterwards the output
channel is closed.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.