pub struct ListenerRegistry { /* private fields */ }Expand description
Listener registry for managing configuration listeners
Implementations§
Source§impl ListenerRegistry
impl ListenerRegistry
pub fn new() -> Self
Sourcepub fn add_listener(
&self,
data_id: &str,
group: &str,
tenant: &str,
listener: Arc<dyn ConfigListener>,
)
pub fn add_listener( &self, data_id: &str, group: &str, tenant: &str, listener: Arc<dyn ConfigListener>, )
Add a listener for a configuration
Sourcepub fn remove_listener(&self, data_id: &str, group: &str, tenant: &str)
pub fn remove_listener(&self, data_id: &str, group: &str, tenant: &str)
Remove a listener for a configuration
Sourcepub fn has_listeners(&self, data_id: &str, group: &str, tenant: &str) -> bool
pub fn has_listeners(&self, data_id: &str, group: &str, tenant: &str) -> bool
Check if a configuration has listeners
Sourcepub fn get_md5(
&self,
data_id: &str,
group: &str,
tenant: &str,
) -> Option<String>
pub fn get_md5( &self, data_id: &str, group: &str, tenant: &str, ) -> Option<String>
Get MD5 for a configuration
Sourcepub fn set_md5(&self, data_id: &str, group: &str, tenant: &str, md5: &str)
pub fn set_md5(&self, data_id: &str, group: &str, tenant: &str, md5: &str)
Set MD5 for a configuration
Sourcepub async fn notify_change(&self, event: ConfigChangeEvent)
pub async fn notify_change(&self, event: ConfigChangeEvent)
Notify listeners of a configuration change
Sourcepub fn get_listen_contexts(&self) -> Vec<(String, String, String, String)>
pub fn get_listen_contexts(&self) -> Vec<(String, String, String, String)>
Get all listened configuration keys with their MD5
Sourcepub fn listener_count(&self) -> usize
pub fn listener_count(&self) -> usize
Get listener count
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ListenerRegistry
impl !RefUnwindSafe for ListenerRegistry
impl Send for ListenerRegistry
impl Sync for ListenerRegistry
impl Unpin for ListenerRegistry
impl !UnwindSafe for ListenerRegistry
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