HLC class

A hybrid logical clock implementation with string-based nodes.

Implemented types

Constructors

HLC({required int timestamp, required int count, required String node})
Constructs an HLC from the given parameters.

Properties

count int
The clock's event count, which breaks ties in the case of identical clocks.
final
hashCode int
The hash code for this object.
no setteroverride
node String
This node's name (or ID), which breaks ties in the case of identical counts.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timestamp int
The clock's timestamp.
final

Methods

compareTo(HLC other) int
Compares this object to another object.
override
copy({int? timestamp, int? count, String? node}) HLC
Constructs a copy of this HLC with the given parameters.
increment() HLC
Produces the next, local clock.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pack() String
Encodes this HLC into a string representation whose topological ordering is equivalent to that of the original HLC.
receive(HLC remote, {Duration? maximumDrift, int? now}) HLC
Synchronizes with a given remote clock.
toString() String
A string representation of this object.
override

Operators

operator ==(dynamic other) bool
The equality operator.
override

Static Properties

delimiter String
The delimiter used for packing and unpacking this HLC in a string.
getter/setter pair

Static Methods

now(String node) HLC
Constructs an initial HLC using the current wall clock.
unpack(String packed) HLC
Decodes an HLC previously packed with pack, else fails with a FormatException.