diff options
author | Valery Piashchynski <[email protected]> | 2021-07-12 12:45:53 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-07-12 12:45:53 +0300 |
commit | aa1437d24ac215bec7fe053b06fa4773c9b1b1ad (patch) | |
tree | 7a6868867877f34ac5e2d490bfb589b3dce02917 /plugins/jobs/brokers/ephemeral/plugin.go | |
parent | 87971c4d310fe3d353197fc96b9b6f9106f01e57 (diff) |
Update JOBS interface, remove List() method, implemented on the root RPC
level.
AMQP consumer replace sync.Map with atomic.Value, because we associate
only 1 pipeline with a driver. So, we can store pipeline in the
atomic.Value.
Implement events handler, add job events. Use job events to push
information to the logger.
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/jobs/brokers/ephemeral/plugin.go')
-rw-r--r-- | plugins/jobs/brokers/ephemeral/plugin.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins/jobs/brokers/ephemeral/plugin.go b/plugins/jobs/brokers/ephemeral/plugin.go index bfe2d6ac..28495abb 100644 --- a/plugins/jobs/brokers/ephemeral/plugin.go +++ b/plugins/jobs/brokers/ephemeral/plugin.go @@ -2,6 +2,7 @@ package ephemeral import ( "github.com/spiral/roadrunner/v2/common/jobs" + "github.com/spiral/roadrunner/v2/pkg/events" priorityqueue "github.com/spiral/roadrunner/v2/pkg/priority_queue" "github.com/spiral/roadrunner/v2/plugins/config" "github.com/spiral/roadrunner/v2/plugins/jobs/pipeline" @@ -30,11 +31,11 @@ func (p *Plugin) Name() string { func (p *Plugin) Available() {} // JobsConstruct creates new ephemeral consumer from the configuration -func (p *Plugin) JobsConstruct(configKey string, pq priorityqueue.Queue) (jobs.Consumer, error) { - return NewJobBroker(configKey, p.log, p.cfg, pq) +func (p *Plugin) JobsConstruct(configKey string, e events.Handler, pq priorityqueue.Queue) (jobs.Consumer, error) { + return NewJobBroker(configKey, p.log, p.cfg, e, pq) } // FromPipeline creates new ephemeral consumer from the provided pipeline -func (p *Plugin) FromPipeline(pipeline *pipeline.Pipeline, pq priorityqueue.Queue) (jobs.Consumer, error) { - return FromPipeline(pipeline, p.log, pq) +func (p *Plugin) FromPipeline(pipeline *pipeline.Pipeline, e events.Handler, pq priorityqueue.Queue) (jobs.Consumer, error) { + return FromPipeline(pipeline, p.log, e, pq) } |