diff options
author | Valery Piashchynski <[email protected]> | 2021-07-07 18:33:04 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-07-07 18:33:04 +0300 |
commit | 60c229c8506df465586434309af5acd1f84e2406 (patch) | |
tree | 18fdf380b7e032415d656e84bcc3c7a057f194a8 /pkg/priorityqueue/interface.go | |
parent | 127186a72d4b8d30f6ada72ade661d8713490728 (diff) |
Updated ephemeral plugin, PQ and protobuf...
Implement core of the root jobs plugin with a proper drivers/pipelines
handling mechanism.
Add delayed jobs for the ephemeral plugin.
Remove ResumeAll, Resume, StopAll, Stop. Replaced with Pause/Resume with
a slice of the pipelines.
Other small improvements.
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'pkg/priorityqueue/interface.go')
-rw-r--r-- | pkg/priorityqueue/interface.go | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/pkg/priorityqueue/interface.go b/pkg/priorityqueue/interface.go index 7ac2e449..100aa667 100644 --- a/pkg/priorityqueue/interface.go +++ b/pkg/priorityqueue/interface.go @@ -5,11 +5,23 @@ type Queue interface { GetMax() Item } +// Item represents binary heap item type Item interface { - ID() *string - Priority() *uint64 + // ID is a unique item identifier + ID() string + + // Priority returns the Item's priority to sort + Priority() uint64 + + // Body is the Item payload Body() []byte - Context() []byte + + // Context is the Item meta information + Context() ([]byte, error) + + // Ack - acknowledge the Item after processing Ack() + + // Nack - discard the Item Nack() } |