summaryrefslogtreecommitdiff
path: root/plugins/jobs/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jobs/config.go')
-rw-r--r--plugins/jobs/config.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/plugins/jobs/config.go b/plugins/jobs/config.go
index 1cb2c2a2..07e2ef38 100644
--- a/plugins/jobs/config.go
+++ b/plugins/jobs/config.go
@@ -1,14 +1,19 @@
package jobs
import (
+ "runtime"
+
poolImpl "github.com/spiral/roadrunner/v2/pkg/pool"
"github.com/spiral/roadrunner/v2/plugins/jobs/pipeline"
)
// Config defines settings for job broker, workers and job-pipeline mapping.
type Config struct {
- // Workers configures roadrunner server and worker busy.
- // Workers *roadrunner.ServerConfig
+ // NumPollers configures number of priority queue pollers
+ // Should be no more than 255
+ // Default - num logical cores
+ NumPollers uint8 `mapstructure:"num_pollers"`
+ // Pool configures roadrunner workers pool.
Pool *poolImpl.Config `mapstructure:"Pool"`
// Pipelines defines mapping between PHP job pipeline and associated job broker.
@@ -23,5 +28,9 @@ func (c *Config) InitDefaults() {
c.Pool = &poolImpl.Config{}
}
+ if c.NumPollers == 0 {
+ c.NumPollers = uint8(runtime.NumCPU())
+ }
+
c.Pool.InitDefaults()
}