class

Swim::Cluster

Inherits Reference < Object

UDP node. Two fibers share one concurrent context, so they never run at the same time. The user fiber can run in parallel, so reads take a lock. Datagrams are copied into a per-fiber outbox before the lock is released. The send happens after the lock. This avoids a lock-order cycle with the socket lock, which is held for the whole receive.

Constructors

new(socket : UDPSocket, core : Core, seal : Seal | Nil, period : Time::Span, port : Int32)
Source

Instance methods

alive?(address : String) : Bool
Source
each

Yields each peer, including this node. Do not call the cluster from the block.

Source
health
Source
port
Source
size
Source
socket
Source
stop
Source

Nested types