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 /common | |
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 'common')
-rw-r--r-- | common/jobs/interface.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/common/jobs/interface.go b/common/jobs/interface.go index 426d5606..e94e97b1 100644 --- a/common/jobs/interface.go +++ b/common/jobs/interface.go @@ -1,6 +1,7 @@ package jobs import ( + "github.com/spiral/roadrunner/v2/pkg/events" priorityqueue "github.com/spiral/roadrunner/v2/pkg/priority_queue" "github.com/spiral/roadrunner/v2/plugins/jobs/pipeline" "github.com/spiral/roadrunner/v2/plugins/jobs/structs" @@ -12,14 +13,12 @@ type Consumer interface { Register(pipeline *pipeline.Pipeline) error Run(pipeline *pipeline.Pipeline) error Stop() error - // List of the pipelines - List() []string Pause(pipeline string) Resume(pipeline string) } type Constructor interface { - JobsConstruct(configKey string, queue priorityqueue.Queue) (Consumer, error) - FromPipeline(pipe *pipeline.Pipeline, queue priorityqueue.Queue) (Consumer, error) + JobsConstruct(configKey string, e events.Handler, queue priorityqueue.Queue) (Consumer, error) + FromPipeline(pipe *pipeline.Pipeline, e events.Handler, queue priorityqueue.Queue) (Consumer, error) } |