Swim::Core
In-memory SWIM engine. Pass now from the caller so tests control time.
The hot path writes packets into one buffer and does not allocate.
Constants
GC_EVERY = 60
HELPERS = 3
MAX_HEALTH = 5
PROBE_SLOTS = 64
Constructors
new(local : Endpoint, *, incarnation : UInt64 = 1_u64, now : Time::Instant = Time.instant, timeout : Time::Span = 500.milliseconds, tombstone : Time::Span = 24.hours, random : Random = Random.new)
SourceInstance methods
Adds a peer, or ignores the update when the current row wins.
each
Sourceeach_deadline
SourceFires due probes. A direct timeout yields ping-req packets.
get(endpoint : Endpoint) : Peer | Nil
Sourcehealth
Sourceincarnation
Sourcepending
SourceApplies one datagram. Yields at most one reply. Returns false for a bad packet.
size
SourceOne probe period. Yields one ping when another peer can be probed.
timeout_span
Source