From 0f70f1e2311640236d74a0a237536779d8d44223 Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Sun, 11 Jul 2021 19:54:35 +0300 Subject: Update JOBS interface, Renamed Consume -> Run. Add DYNAMIC declaration of the pipelines. Update Jobs constructor interface, add FromPipeline method to construct jobs driver (unique) via the `Declare` RPC call. Add `Stop` method to gracefully stop all consumers. Binary heaps `GetMax` to canonical `ExtractMin`. Other small improvements. Signed-off-by: Valery Piashchynski --- common/jobs/interface.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'common') diff --git a/common/jobs/interface.go b/common/jobs/interface.go index 9c7ffef8..426d5606 100644 --- a/common/jobs/interface.go +++ b/common/jobs/interface.go @@ -10,7 +10,8 @@ import ( type Consumer interface { Push(job *structs.Job) error Register(pipeline *pipeline.Pipeline) error - Consume(pipeline *pipeline.Pipeline) error + Run(pipeline *pipeline.Pipeline) error + Stop() error // List of the pipelines List() []string @@ -20,4 +21,5 @@ type Consumer interface { type Constructor interface { JobsConstruct(configKey string, queue priorityqueue.Queue) (Consumer, error) + FromPipeline(pipe *pipeline.Pipeline, queue priorityqueue.Queue) (Consumer, error) } -- cgit v1.2.3