pub struct InMemoryBackplane { /* private fields */ }Expand description
Single-process Backplane: an in-memory registry with direct local
delivery. The default — keeps the server runnable standalone. Multi-pod
deployments install a Redis / NATS impl instead.
Implementations§
Source§impl InMemoryBackplane
impl InMemoryBackplane
pub fn new() -> Self
Sourcepub fn connection_count(&self) -> usize
pub fn connection_count(&self) -> usize
Test/inspection helper: number of attached connections.
Trait Implementations§
Source§impl Backplane for InMemoryBackplane
impl Backplane for InMemoryBackplane
Source§fn attach<'life0, 'life1, 'async_trait>(
&'life0 self,
conn_id: &'life1 str,
sink: LocalSink,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn attach<'life0, 'life1, 'async_trait>(
&'life0 self,
conn_id: &'life1 str,
sink: LocalSink,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Attach a connection’s local outbound sink — this pod owns the socket.
Idempotent re-attach replaces the sink. The connection is always
reachable by
Target::Connection with its own id.Source§fn detach<'life0, 'life1, 'async_trait>(
&'life0 self,
conn_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn detach<'life0, 'life1, 'async_trait>(
&'life0 self,
conn_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Detach a connection and drop all of its target associations and its local
sink (call on disconnect).
Source§fn associate<'life0, 'life1, 'async_trait>(
&'life0 self,
conn_id: &'life1 str,
target: Target,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn associate<'life0, 'life1, 'async_trait>(
&'life0 self,
conn_id: &'life1 str,
target: Target,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Associate a connection with a target (idempotent). Learned over the
connection’s life: the session at
create_conversation_session, the
user/org from auth, etc.Source§fn publish<'life0, 'async_trait>(
&'life0 self,
target: Target,
event: Value,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn publish<'life0, 'async_trait>(
&'life0 self,
target: Target,
event: Value,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Deliver
event to every connection associated with target. Returns the
number of local deliveries made on this pod; cross-pod impls also fan
the event out to other pods (whose local deliveries this count omits).Source§impl Default for InMemoryBackplane
impl Default for InMemoryBackplane
Source§fn default() -> InMemoryBackplane
fn default() -> InMemoryBackplane
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for InMemoryBackplane
impl RefUnwindSafe for InMemoryBackplane
impl Send for InMemoryBackplane
impl Sync for InMemoryBackplane
impl Unpin for InMemoryBackplane
impl UnsafeUnpin for InMemoryBackplane
impl UnwindSafe for InMemoryBackplane
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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>
Wrap the input message
T in a tonic::Request