class documentation

class WorkList(Generic[T]):

Constructor: WorkList()

View In Hierarchy

Priority queue for commit processing using a min-heap.

Method __init__ Initialize an empty work list.
Method add Add an item to the work list.
Method get Get the highest priority item from the work list.
Method iter Iterate over items in the work list.
Instance Variable pq Undocumented
def __init__(self):

Initialize an empty work list.

def add(self, item: tuple[int, T]):

Add an item to the work list.

Parameters
item:tuple[int, T]Tuple of (timestamp, commit)
def get(self) -> tuple[int, T] | None:

Get the highest priority item from the work list.

Returns
tuple[int, T] | NoneTuple of (timestamp, commit) or None if empty
def iter(self) -> Iterator[tuple[int, T]]:

Iterate over items in the work list.

Yields
Tuples of (timestamp, commit)
pq: list[tuple[int, T]] =

Undocumented