diff options
author | Valery Piashchynski <[email protected]> | 2021-07-11 19:54:35 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-07-11 19:54:35 +0300 |
commit | 0f70f1e2311640236d74a0a237536779d8d44223 (patch) | |
tree | 8b2e9dc32b5b6bafe418083c33cce3dbb8f277c7 /common | |
parent | 240b114e1ea3c1414bcd9f4d2c050d56c467222f (diff) |
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 <[email protected]>
Diffstat (limited to 'common')
-rw-r--r-- | common/jobs/interface.go | 4 |
1 files changed, 3 insertions, 1 deletions
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) } |