pub struct InProcessRelay { /* private fields */ }Available on crate feature
cluster only.Expand description
An in-process ClusterRelay for one node: mirrors a peer’s stream into
the local engine.
Implementations§
Source§impl InProcessRelay
impl InProcessRelay
Sourcepub fn new(
node: impl Into<NodeAddr>,
local: Arc<dyn PublishRegistry>,
directory: Arc<ClusterDirectory>,
) -> Self
pub fn new( node: impl Into<NodeAddr>, local: Arc<dyn PublishRegistry>, directory: Arc<ClusterDirectory>, ) -> Self
A relay for node, mirroring into local, discovering via directory.
Sourcepub fn with_peer(
self,
addr: impl Into<NodeAddr>,
playback: Arc<dyn PlaybackRegistry>,
) -> Self
pub fn with_peer( self, addr: impl Into<NodeAddr>, playback: Arc<dyn PlaybackRegistry>, ) -> Self
Register a peer node’s playback registry so pull
can subscribe to its streams.
Sourcepub fn with_reconnect(self, reconnect: bool) -> Self
pub fn with_reconnect(self, reconnect: bool) -> Self
Opt into reconnect/failover parity with the network relay: when a
mirrored origin’s stream ends, re-locate the
stream (excluding the node that just failed) and resume from a live
replica, keeping the same local publish handle — viewers don’t see the
stream drop. Stops when the stream is gone everywhere or on
withdraw. Off by default (one-shot), keeping
the reference minimal. Pair with ClusterDirectory::with_ttl so a
crashed origin’s lease lapses and failover actually has somewhere to go.
Trait Implementations§
Source§impl ClusterRelay for InProcessRelay
impl ClusterRelay for InProcessRelay
Source§fn locate<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StreamKey,
) -> Pin<Box<dyn Future<Output = Result<Option<NodeAddr>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn locate<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StreamKey,
) -> Pin<Box<dyn Future<Output = Result<Option<NodeAddr>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Find a node currently serving
key, if any (e.g. via the control plane).Source§fn pull<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 StreamKey,
origin: &'life2 NodeAddr,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn pull<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 StreamKey,
origin: &'life2 NodeAddr,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Begin relaying
key from origin into the local engine, returning once
the local mirror is publishing.Source§fn announce<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StreamKey,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn announce<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StreamKey,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Advertise that this node serves
key so edges can discover it.Source§fn withdraw<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StreamKey,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn withdraw<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StreamKey,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Withdraw a previous
announce when the stream ends.Auto Trait Implementations§
impl !Freeze for InProcessRelay
impl !RefUnwindSafe for InProcessRelay
impl !UnwindSafe for InProcessRelay
impl Send for InProcessRelay
impl Sync for InProcessRelay
impl Unpin for InProcessRelay
impl UnsafeUnpin for InProcessRelay
Blanket Implementations§
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
Mutably borrows from an owned value. Read more