Documentation
¶
Overview ¶
Package lock defines interfaces for a priority-based lock queue in RoadRunner. The Queue interface manages lock items ordered by priority, supporting Insert, Remove, and ExtractMin operations. Each Item carries an ID, GroupID, and Priority used for ordering within the queue.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item interface {
// ID returns a unique identifier for the item
ID() string
// GroupID returns the group associated with the item, used to remove all items with the same groupID
GroupID() string
// Priority returns the priority level used to sort the item
Priority() int64
}
Item interface represents the base meta-information which any priority queue message must have
type Queue ¶
type Queue interface {
// Remove removes element with provided ID (if exists) and returns that elements
Remove(id string) []Item
// Insert adds an item to the queue
Insert(item Item)
// ExtractMin returns the item with the highest priority (less value is the highest priority)
ExtractMin() Item
// Len returns the number of items in the queue
Len() uint64
}
Queue represents Lock plugin queue with it's elements types inside
Click to show internal directories.
Click to hide internal directories.