summaryrefslogtreecommitdiff
path: root/static_pool.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-11-16 14:21:35 +0300
committerValery Piashchynski <[email protected]>2020-11-16 14:21:35 +0300
commit57ad958acab2d108be0a35547faf6e7a791cf069 (patch)
tree3c519708540265a7e74b03d1fe17ef4101ffcfdf /static_pool.go
parentd890eee1742dc3a0a1c787f7e65d40b1e81a94db (diff)
Update Pool
Diffstat (limited to 'static_pool.go')
-rwxr-xr-xstatic_pool.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/static_pool.go b/static_pool.go
index 0e5ee050..4e49b212 100755
--- a/static_pool.go
+++ b/static_pool.go
@@ -29,7 +29,7 @@ type PoolOptions func(p *StaticPool)
// StaticPool controls worker creation, destruction and task routing. Pool uses fixed amount of stack.
type StaticPool struct {
- cfg Config
+ cfg PoolConfig
// worker command creator
cmd func() *exec.Cmd
@@ -52,7 +52,7 @@ type StaticPool struct {
}
// NewPool creates new worker pool and task multiplexer. StaticPool will initiate with one worker.
-func NewPool(ctx context.Context, cmd func() *exec.Cmd, factory Factory, cfg Config, options ...PoolOptions) (Pool, error) {
+func NewPool(ctx context.Context, cmd func() *exec.Cmd, factory Factory, cfg PoolConfig, options ...PoolOptions) (Pool, error) {
const op = errors.Op("NewPool")
cfg.InitDefaults()
@@ -75,13 +75,13 @@ func NewPool(ctx context.Context, cmd func() *exec.Cmd, factory Factory, cfg Con
workers, err := p.allocateWorkers(ctx, p.cfg.NumWorkers)
if err != nil {
- return nil, err
+ return nil, errors.E(op, err)
}
// put stack in the pool
err = p.ww.AddToWatch(ctx, workers)
if err != nil {
- return nil, err
+ return nil, errors.E(op, err)
}
p.errEncoder = defaultErrEncoder(p)
@@ -119,8 +119,8 @@ func (sp *StaticPool) AddListener(listener util.EventListener) {
sp.events.AddListener(listener)
}
-// Config returns associated pool configuration. Immutable.
-func (sp *StaticPool) GetConfig() Config {
+// PoolConfig returns associated pool configuration. Immutable.
+func (sp *StaticPool) GetConfig() PoolConfig {
return sp.cfg
}