Skip to main content

Sequencer

This class is a thread-safe incremental integer counter. It provides methods to retrieve the next available integer and the current integer. Note that it is a singleton, so the sequence may not always start at 0.

Methods


GetNext()

@classmethod
def GetNext() - > uint64

Retrieves the next sequential unsigned 64-bit integer. Callers use this to obtain a unique, incrementing identifier.

Returns

TypeDescription
uint64The next available unsigned 64-bit integer in the sequence.

GetCur()

@classmethod
def GetCur() - > uint64

Retrieves the current unsigned 64-bit integer value of the sequencer without incrementing it. Callers use this to inspect the last generated sequence number.

Returns

TypeDescription
uint64The current unsigned 64-bit integer value of the sequencer.