AntiEntropy class

The periodic state exchange that heals a dropped frame without a manual forceSync.

Sync is push-based: a frame lost to a flaky link or the inbound rate limiter would otherwise stay lost until the next reconnect. Every interval, exchange runs — a Hello to each connected peer, whose state/delta replies carry anything either side is missing. Duration.zero disables it ("push only" stays a valid configuration).

Owned by a Database; stop is called on close and leave, after which no further exchange runs.

Constructors

AntiEntropy({required Duration interval, required Future<void> exchange(), AntiEntropyTimerFactory timerFactory = _periodic})
Creates the exchange driver. Call start to begin ticking.

Properties

hashCode → int
The hash code for this object.
no setterinherited
interval → Duration
Time between exchanges. Duration.zero disables the timer entirely.
final
isRunning → bool
Whether the periodic timer is currently armed.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
start() → void
Arms the timer. A zero (or negative) interval is a no-op. Idempotent.
stop() → void
Cancels the timer; no exchange runs after this. Idempotent.
tick() → void
Runs one exchange now. Overlapping ticks collapse: a tick that fires while the previous exchange is still running is skipped, so a slow peer cannot pile up exchanges.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited