Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Printf = LoggerFunc(log.Printf)
Functions ¶
func NewWorker ¶
func NewWorker(id int, pool *WorkerPool) *worker
Types ¶
type JobWithArgs ¶
type JobWithArgs struct {
// contains filtered or unexported fields
}
type LoggerFunc ¶
type LoggerFunc func(string, ...interface{})
func (LoggerFunc) Printf ¶
func (f LoggerFunc) Printf(msg string, args ...interface{})
type Option ¶
type Option func(*WorkerPool)
func WithLogger ¶
func WithMaxQueue ¶
func WithMaxWorkers ¶
func WithOnError ¶ added in v1.0.2
type WorkerPool ¶
type WorkerPool struct {
Logger Logger
Wg sync.WaitGroup
// contains filtered or unexported fields
}
func New ¶
func New(opts ...Option) *WorkerPool
func (*WorkerPool) Add ¶ added in v1.0.2
func (w *WorkerPool) Add(fn Job, args ...interface{})
func (*WorkerPool) Close ¶
func (w *WorkerPool) Close()
func (*WorkerPool) Run ¶
func (w *WorkerPool) Run() *WorkerPool
func (*WorkerPool) WorkerCount ¶
func (w *WorkerPool) WorkerCount() int
Click to show internal directories.
Click to hide internal directories.