abstract class Raft::Transport

Overview

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.

Direct Known Subclasses

Defined in:

raft/transport.cr

Instance Method Summary

Instance Method Detail

abstract def 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.


[View source]
abstract def 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.


[View source]
abstract def stop : Nil #

Shuts down the transport, closing all connections and listeners.


[View source]