Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Impl ¶
type Impl struct {
// contains filtered or unexported fields
}
Impl is the Pool interface implementation
func (*Impl) GetInfoChannel ¶
func (p *Impl) GetInfoChannel() chan *WorkerInfo
GetInfoChannel returns the info channel used on pool
*The info channel will receive information about finished *tasks. *on shutdown it will receive all tasks which are not *runned yet
func (*Impl) SetMaxPoolSize ¶
SetMaxPoolSize pool max size to a different number
- It should change the pull size and start more workers
- if it the new pool size is greater then the previous one
- and if there is more workers to start.
- if the new pull size is lower, it should do nothing,
- because when a current task finish it will check if
- it should call a new worker or not.
type Pool ¶
type Pool interface { // Server will be a pool server which will wait until a shootdown as send Server() // Add worker to pool Add(f func(taskID string) error) (id string, err error) // SetMaxPoolSize pool max size to a different number SetMaxPoolSize(s int) // Shutdown start shutdown pool server Shutdown() GetInfoChannel() chan *WorkerInfo }
Pool to create a pool
Click to show internal directories.
Click to hide internal directories.