Skip to main content

ClusterRelay

Trait ClusterRelay 

Source
pub trait ClusterRelay:
    Send
    + Sync
    + 'static {
    // Required methods
    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 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 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 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;
}
Expand description

Origin/edge relay contract. Implement to federate streams across nodes: an edge that lacks a stream locally locates its origin and pulls it; an origin announces what it has.

Required Methods§

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,

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,

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,

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,

Withdraw a previous announce when the stream ends.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§