pub struct RedexReplicationRouter { /* private fields */ }Expand description
Per-Redex registry of runtime handles, dispatching by
channel id. Cheap to clone (everything is Arc) so the same
router can be shared between Redex (for registration) and
MeshNode (for inbound dispatch).
Implementations§
Source§impl RedexReplicationRouter
impl RedexReplicationRouter
Sourcepub fn register(
&self,
channel_id: ChannelId,
handle: Arc<ReplicationRuntimeHandle>,
) -> Option<Arc<ReplicationRuntimeHandle>>
pub fn register( &self, channel_id: ChannelId, handle: Arc<ReplicationRuntimeHandle>, ) -> Option<Arc<ReplicationRuntimeHandle>>
Register a runtime handle under channel_id. Returns the
previously-registered handle if one existed, so the caller
can cancel it cleanly. Re-registration is the
RedexFileConfig::replication update path — same channel,
new config, new runtime.
Sourcepub fn get(
&self,
channel_id: &ChannelId,
) -> Option<Arc<ReplicationRuntimeHandle>>
pub fn get( &self, channel_id: &ChannelId, ) -> Option<Arc<ReplicationRuntimeHandle>>
Look up a runtime handle. Cloned Arc so the caller can
drive the handle (dispatch events, cancel) without
holding the DashMap shard lock.
Sourcepub fn unregister(
&self,
channel_id: &ChannelId,
) -> Option<Arc<ReplicationRuntimeHandle>>
pub fn unregister( &self, channel_id: &ChannelId, ) -> Option<Arc<ReplicationRuntimeHandle>>
Remove the registration for channel_id. Returns the
removed handle, if any, so the caller can cancel + await
its exit deterministically.
Sourcepub fn snapshot_handles(
&self,
) -> Vec<(ChannelId, Arc<ReplicationRuntimeHandle>)>
pub fn snapshot_handles( &self, ) -> Vec<(ChannelId, Arc<ReplicationRuntimeHandle>)>
Snapshot every registered (ChannelId, handle) pair. The
Arc clone is cheap; the caller can iterate without
holding shard locks. Consumed by Redex to build the
per-channel status snapshot for operator observability.