summaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'config.go')
-rw-r--r--config.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/config.go b/config.go
index e48cefc2..02008181 100644
--- a/config.go
+++ b/config.go
@@ -9,34 +9,34 @@ import (
type Config struct {
// NumWorkers defines how many sub-processes can be run at once. This value
// might be doubled by Swapper while hot-swap.
- NumWorkers uint64
+ NumWorkers int64
- // MaxExecutions defines how many executions is allowed for the worker until
+ // MaxJobs defines how many executions is allowed for the worker until
// it's destruction. set 1 to create new process for each new task, 0 to let
// worker handle as many tasks as it can.
- MaxExecutions uint64
+ MaxJobs int64
// AllocateTimeout defines for how long pool will be waiting for a worker to
// be freed to handle the task.
- AllocateTimeout time.Duration
+ AllocateTimeout time.Duration //todo: to milleseconds?
// DestroyTimeout defines for how long pool should be waiting for worker to
// properly stop, if timeout reached worker will be killed.
- DestroyTimeout time.Duration
+ DestroyTimeout time.Duration //todo: to milleseconds?
}
-// Valid returns error if config not valid
+// Reconfigure returns error if cfg not valid
func (cfg *Config) Valid() error {
if cfg.NumWorkers == 0 {
- return fmt.Errorf("config.NumWorkers must be set")
+ return fmt.Errorf("pool.NumWorkers must be set")
}
if cfg.AllocateTimeout == 0 {
- return fmt.Errorf("config.AllocateTimeout must be set")
+ return fmt.Errorf("pool.AllocateTimeout must be set")
}
if cfg.DestroyTimeout == 0 {
- return fmt.Errorf("config.DestroyTimeout must be set")
+ return fmt.Errorf("pool.DestroyTimeout must be set")
}
return nil