diff options
author | Valery Piashchynski <[email protected]> | 2021-06-22 17:33:55 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-06-22 17:33:55 +0300 |
commit | 035e432af9a059e9e5187bd03f2e7864ed94c054 (patch) | |
tree | 16383fdb9ee7c635e14cd1898ec573f331ba8d30 /plugins/jobs/config.go | |
parent | 5627146e45afbb8f6566862c60a42a0b0aad2d0a (diff) |
- Folders struct
- Initial ephemeral broker commit
- Initial RPC
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/jobs/config.go')
-rw-r--r-- | plugins/jobs/config.go | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/plugins/jobs/config.go b/plugins/jobs/config.go index 4606ccba..1e49b959 100644 --- a/plugins/jobs/config.go +++ b/plugins/jobs/config.go @@ -3,6 +3,9 @@ package jobs import ( "github.com/spiral/errors" poolImpl "github.com/spiral/roadrunner/v2/pkg/pool" + "github.com/spiral/roadrunner/v2/plugins/jobs/dispatcher" + "github.com/spiral/roadrunner/v2/plugins/jobs/pipeline" + "github.com/spiral/roadrunner/v2/plugins/jobs/structs" ) // Config defines settings for job broker, workers and job-pipeline mapping. @@ -12,23 +15,23 @@ type Config struct { poolCfg poolImpl.Config // Dispatch defines where and how to match jobs. - Dispatch map[string]*Options + Dispatch map[string]*structs.Options // Pipelines defines mapping between PHP job pipeline and associated job broker. - Pipelines map[string]*Pipeline + Pipelines map[string]*pipeline.Pipeline // Consuming specifies names of pipelines to be consumed on service start. Consume []string // parent config for broken options. - pipelines Pipelines - route Dispatcher + pipelines pipeline.Pipelines + route dispatcher.Dispatcher } func (c *Config) InitDefaults() error { const op = errors.Op("config_init_defaults") var err error - c.pipelines, err = initPipelines(c.Pipelines) + c.pipelines, err = pipeline.InitPipelines(c.Pipelines) if err != nil { return errors.E(op, err) } @@ -36,9 +39,9 @@ func (c *Config) InitDefaults() error { } // MatchPipeline locates the pipeline associated with the job. -func (c *Config) MatchPipeline(job *Job) (*Pipeline, *Options, error) { +func (c *Config) MatchPipeline(job *structs.Job) (*pipeline.Pipeline, *structs.Options, error) { const op = errors.Op("config_match_pipeline") - opt := c.route.match(job) + opt := c.route.Match(job) pipe := "" if job.Options != nil { |