Documentation ¶
Index ¶
- Constants
- type Options
- type Pool
- func (sp *Pool) Destroy(ctx context.Context)
- func (sp *Pool) Exec(ctx context.Context, p *payload.Payload) (*payload.Payload, error)
- func (sp *Pool) GetConfig() *pool.Config
- func (sp *Pool) QueueSize() uint64
- func (sp *Pool) RemoveWorker(wb *worker.Process) error
- func (sp *Pool) Reset(ctx context.Context) error
- func (sp *Pool) Start()
- func (sp *Pool) Stop()
- func (sp *Pool) Workers() (workers []*worker.Process)
Constants ¶
View Source
const ( MB = 1024 * 1024 // NSEC_IN_SEC nanoseconds in second NSEC_IN_SEC int64 = 1000000000 //nolint:stylecheck )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool controls worker creation, destruction and task routing. Pool uses fixed amount of stack.
func NewPool ¶
func NewPool(ctx context.Context, cmd pool.Command, factory pool.Factory, cfg *pool.Config, log *zap.Logger) (*Pool, error)
NewPool creates new worker pool and task multiplexer. Pool will initiate with one worker. If supervisor configuration is provided -> pool will be turned into a supervisedExec mode
func (*Pool) RemoveWorker ¶
RemoveWorker function should not be used outside the `Wait` function
Click to show internal directories.
Click to hide internal directories.