pub struct SubscriberRegistry { /* private fields */ }Expand description
Subscriber registry for managing service subscriptions
Implementations§
Source§impl SubscriberRegistry
impl SubscriberRegistry
pub fn new() -> Self
Sourcepub fn subscribe(
&self,
namespace: &str,
group_name: &str,
service_name: &str,
listener: Arc<dyn ServiceListener>,
)
pub fn subscribe( &self, namespace: &str, group_name: &str, service_name: &str, listener: Arc<dyn ServiceListener>, )
Subscribe to a service
Sourcepub fn unsubscribe(&self, namespace: &str, group_name: &str, service_name: &str)
pub fn unsubscribe(&self, namespace: &str, group_name: &str, service_name: &str)
Unsubscribe from a service
Sourcepub fn has_subscribers(
&self,
namespace: &str,
group_name: &str,
service_name: &str,
) -> bool
pub fn has_subscribers( &self, namespace: &str, group_name: &str, service_name: &str, ) -> bool
Check if a service has subscribers
Sourcepub async fn notify(&self, event: ServiceChangeEvent)
pub async fn notify(&self, event: ServiceChangeEvent)
Notify listeners of a service change
Sourcepub fn get_subscribed_services(&self) -> Vec<(String, String, String)>
pub fn get_subscribed_services(&self) -> Vec<(String, String, String)>
Get all subscribed service keys
Sourcepub fn subscriber_count(&self) -> usize
pub fn subscriber_count(&self) -> usize
Get subscriber count
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SubscriberRegistry
impl !RefUnwindSafe for SubscriberRegistry
impl Send for SubscriberRegistry
impl Sync for SubscriberRegistry
impl Unpin for SubscriberRegistry
impl !UnwindSafe for SubscriberRegistry
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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