blob: 100aa6675d8ca1ae957ebe54da5fc5bd04c0d4d2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
package priorityqueue
type Queue interface {
Insert(item Item)
GetMax() Item
}
// Item represents binary heap item
type Item interface {
// 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 is the Item meta information
Context() ([]byte, error)
// Ack - acknowledge the Item after processing
Ack()
// Nack - discard the Item
Nack()
}
|