class

Raft::Transport

Inherits Reference < Object

Abstract base class for Raft node-to-node communication.

Implementations deliver RPC messages between cluster nodes. The library ships with Transport::InMemory for testing and Transport::TCP for production use.

Instance methods

send(peer_id : String, message : RPC::Message) : Nil

Sends an RPC message to the peer identified by peer_id.

Delivery is best-effort. If the peer is unreachable the message is silently dropped — Raft's protocol-level retries handle the loss.

Source
start(inbox : Channel(RPC::Envelope)) : Nil

Starts listening for incoming messages.

Received messages are wrapped in RPC::Envelope (tagged with sender ID) and pushed into the provided inbox channel.

Source
stop

Shuts down the transport, closing all connections and listeners.

Source

Nested types