Documentation ¶
Overview ¶
Package workpool for do task in work pool.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶ added in v1.10.4
type Logger interface {
Println(args ...interface{})
}
Logger log record interface
type LoggerFunc ¶ added in v1.10.7
type LoggerFunc func(...interface{})
LoggerFunc is a bridge between Logger and any third party logger.
func (LoggerFunc) Println ¶ added in v1.10.7
func (f LoggerFunc) Println(args ...interface{})
Println implements Logger interface.
type Option ¶ added in v1.10.4
type Option func(p *Pool)
Option func Option to change pool.
func WithEntryCap ¶ added in v1.10.7
WithEntryNum task entry chan number.
func WithEntryCloseWait ¶ added in v1.10.7
WithEntryCloseWait close entry chan entryCloseWait time.
func WithExecInterval ¶ added in v1.10.7
WithExecInterval interval time after each task is executed.
func WithLogger ¶ added in v1.10.4
WithLogger change logger entry.
func WithShutdownWait ¶ added in v1.10.4
WithShutdownWait change shutdown entryCloseWait time.
func WithWorkerCap ¶ added in v1.10.7
WithWorkerCap change worker num.
type Pool ¶ added in v1.10.4
type Pool struct {
// contains filtered or unexported fields
}
Pool task work pool
func (*Pool) BatchAddTask ¶ added in v1.10.4
BatchAddTask batch add task to p.entryChan.
Click to show internal directories.
Click to hide internal directories.