pub trait Backplane: Send + Sync {
// Required methods
fn publish<'life0, 'async_trait>(
&'life0 self,
message: BackplaneMessage,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn subscribe(&self) -> Receiver<BackplaneMessage>;
}Expand description
A multi-node notification channel.
Implement over Redis pub/sub, NATS, etc. The cache publishes on local changes and subscribes to apply remote ones.
Required Methods§
Sourcefn publish<'life0, 'async_trait>(
&'life0 self,
message: BackplaneMessage,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn publish<'life0, 'async_trait>(
&'life0 self,
message: BackplaneMessage,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Publishes a message to all other subscribers.
§Errors
Returns Error::Backplane on transport failure.
Sourcefn subscribe(&self) -> Receiver<BackplaneMessage>
fn subscribe(&self) -> Receiver<BackplaneMessage>
Subscribes to the message stream.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".