Documentation ¶
Overview ¶
Package lclock implements Lamport logical clocks, with helps to be used in the context of rdocEvery operation has an unique ID in the network. Lamport timestamps ensure that if two operations in different network nodes have occurred concurrently, their order is arbitrary but deterministic
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Clock ¶
type Clock struct {
// contains filtered or unexported fields
}
Clock holds a Lamport logical clock
func ConvertString ¶
ConvertString converts a string to a clock representation, or returns an error if string representation is invalid
func New ¶
New initializes and returns a new clock. The `seed` is a string which uniquely identifies the clock in the network
func (Clock) CheckTick ¶
CheckTick checks if tick belongs to the clock, or if tick representation is invalid