diff options
Diffstat (limited to 'static_pool.go')
-rwxr-xr-x | static_pool.go | 12 |
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 } |