Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrPoolFull = errors.New("pool is full")
Functions ¶
This section is empty.
Types ¶
type IdentifiableJob ¶
type IdentifiableJob struct {
// contains filtered or unexported fields
}
func NewCustomIdentifierJob ¶
func NewCustomIdentifierJob(id string, execFunc func()) *IdentifiableJob
func NewIdentifiableJob ¶
func NewIdentifiableJob(execFunc func()) *IdentifiableJob
func (IdentifiableJob) Exec ¶
func (c IdentifiableJob) Exec()
func (IdentifiableJob) Id ¶
func (c IdentifiableJob) Id() string
type OptionFunc ¶
type OptionFunc func(opt *Option)
func WithCapacity ¶
func WithCapacity(capacity int) OptionFunc
func WithLogFunc ¶
func WithLogFunc(logFunc LogFunc) OptionFunc
func WithMode ¶
func WithMode(mode Mode) OptionFunc
func WithNumberWorkers ¶
func WithNumberWorkers(numberWorkers int) OptionFunc
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
func NewFixedSize ¶
func NewFixedSize(numberWorkers int, optionFunc ...OptionFunc) *Pool
func (Pool) AssignedJobs ¶
func (*Pool) SubmitConfidently ¶
SubmitConfidently submit a job in confidently mode. This will return ErrPoolFull when Pool queue is full.
func (*Pool) SubmitFunc ¶
func (p *Pool) SubmitFunc(f func())
SubmitFunc a func job. Fast way to Submit(FuncJob(func() {}))
func (Pool) SubmittedJobs ¶
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
func (Worker) BusiedDuration ¶
func (Worker) IdledDuration ¶
func (Worker) RunningJobId ¶
func (Worker) WorkedJobs ¶
Click to show internal directories.
Click to hide internal directories.