lock

package
v6.0.0-beta.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2026 License: MIT Imports: 0 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL