Skip to main content

ReplicationInboundRouter

Trait ReplicationInboundRouter 

Source
pub trait ReplicationInboundRouter: Send + Sync {
    // Required method
    fn try_route(
        &self,
        channel_id: ChannelId,
        inbound: Inbound,
    ) -> Result<(), Inbound>;
}
Expand description

Sync, non-blocking router the mesh’s inbound dispatch hot path calls when a SUBPROTOCOL_REDEX payload arrives. Owns the per-channel registry of ReplicationRuntimeHandles and routes the decoded Inbound event to the right one.

Returns Err(Inbound) (the event, returned) when:

  • No runtime is registered for channel_id (channel not opened on this node, or the runtime was canceled and not yet unregistered).
  • The runtime’s inbox is full (per-channel backlog at RUNTIME_INBOX_CAPACITY).

In both cases the caller (mesh dispatch loop) drops + logs; the wire layer’s reliable-stream may retransmit, or the peer’s heartbeat cycle will recover state without it.

Required Methods§

Source

fn try_route( &self, channel_id: ChannelId, inbound: Inbound, ) -> Result<(), Inbound>

Try to route an inbound event to its channel’s runtime. Sync + non-blocking — must not call into async code, must not hold locks across awaits (the mesh dispatch loop is the sole caller and runs in a synchronous critical section).

Implementors§