ClockSyncService class final
Drives PeerClockEstimators on timers and sends probes through a callback.
One of these per node. It owns the burst schedule; the actual message send is injected as sendProbe so this class stays free of any coordination or transport types.
Constructors
- ClockSyncService({required void sendProbe(String peerUId, int waveId, int probeIndex), required PeerClockOffsets offsets, ClockSyncConfig? config, Random? random})
Properties
- config → ClockSyncConfig
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- offsets → PeerClockOffsets
-
Where accepted estimates are published for readers to pick up.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sendProbe → void Function(String peerUId, int waveId, int probeIndex)
-
Sends one probe request to a peer. Fire-and-forget by design: a probe that
fails to send is simply a reply that never arrives, which the minimum-probe
gate already handles.
final
-
trackedPeers
→ Iterable<
String> -
Peers currently being probed.
no setter
Methods
-
dispose(
) → void -
estimatorFor(
String peerUId) → PeerClockEstimator? -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
recordReply(
String peerUId, int waveId, ClockProbeSample sample) → bool - Feeds a reply in. Returns false if it was stale or the peer is untracked.
-
toString(
) → String -
A string representation of this object.
inherited
-
trackPeer(
String peerUId) → void -
Begins probing
peerUId. Call this when an inlet from that peer is created; idempotent, so a re-discovered peer does not get two schedules. -
untrackPeer(
String peerUId) → void -
Stops probing
peerUIdand forgets its offset. Call when the inlet goes away — a stale offset for a departed peer is worse than none.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited