pub struct RemoteSync { /* private fields */ }Expand description
Manages subscription tracking and restore for remote (non-peer) connections.
Event-driven interface used by the message processor:
on_forwarded_subscription: a sub was sent to a remote connon_connection_drop: a remote connection was lostget_subscriptions_for_reconnect: snapshot before client reconnectrestore: replay subscriptions after reconnect
Implementations§
Source§impl RemoteSync
impl RemoteSync
Sourcepub fn on_forwarded_subscription(
&self,
source: ProtoName,
name: ProtoName,
source_identity: String,
conn: u64,
add: bool,
subscription_id: u64,
)
pub fn on_forwarded_subscription( &self, source: ProtoName, name: ProtoName, source_identity: String, conn: u64, add: bool, subscription_id: u64, )
Record that a subscription was forwarded (or unforwarded) on a remote connection.
Sourcepub fn on_connection_drop(&self, conn: u64) -> HashSet<SubscriptionInfo>
pub fn on_connection_drop(&self, conn: u64) -> HashSet<SubscriptionInfo>
A remote connection dropped — remove and return its tracked subscriptions.
Sourcepub fn get_subscriptions_for_reconnect(
&self,
conn: u64,
) -> HashSet<SubscriptionInfo>
pub fn get_subscriptions_for_reconnect( &self, conn: u64, ) -> HashSet<SubscriptionInfo>
Snapshot the subscriptions forwarded on a connection (for client-side reconnect).
Unlike on_connection_drop, this does NOT remove them from the table.
Sourcepub async fn restore(
&self,
mp: &MessageProcessor,
remote_subs: &HashSet<SubscriptionInfo>,
conn_index: u64,
restore_tracking: bool,
)
pub async fn restore( &self, mp: &MessageProcessor, remote_subs: &HashSet<SubscriptionInfo>, conn_index: u64, restore_tracking: bool, )
Re-send previously-forwarded subscriptions to a remote connection after reconnect.
When restore_tracking is true, also re-registers each subscription in the
tracking table.
When restore_tracking is false (client-side reconnect), the tracking table was
never cleaned (reconnect reuses the same slot), so no re-registration is needed.
Trait Implementations§
Source§impl Debug for RemoteSync
impl Debug for RemoteSync
Source§impl Default for RemoteSync
impl Default for RemoteSync
Source§fn default() -> RemoteSync
fn default() -> RemoteSync
Auto Trait Implementations§
impl !Freeze for RemoteSync
impl !RefUnwindSafe for RemoteSync
impl Send for RemoteSync
impl Sync for RemoteSync
impl Unpin for RemoteSync
impl UnsafeUnpin for RemoteSync
impl UnwindSafe for RemoteSync
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request