pub struct WatchRegistry { /* private fields */ }Expand description
Watch registry - manages watcher registration (Arc-shareable)
This is the shared state that both Builder (for registration) and WatchDispatcher (for event dispatch) can access concurrently.
Implementations§
Source§impl WatchRegistry
impl WatchRegistry
Sourcepub fn new(
watcher_buffer_size: usize,
unregister_tx: UnboundedSender<(u64, Bytes)>,
) -> Self
pub fn new( watcher_buffer_size: usize, unregister_tx: UnboundedSender<(u64, Bytes)>, ) -> Self
Create a new watch registry
§Arguments
watcher_buffer_size- Buffer size for per-watcher mpsc channelsunregister_tx- Channel for receiving unregister requests
Sourcepub fn register(&self, key: Bytes) -> WatcherHandle
pub fn register(&self, key: Bytes) -> WatcherHandle
Register a new watcher for a specific key
Returns a handle that receives watch events via an mpsc channel. The watcher is automatically unregistered when the handle is dropped.
Auto Trait Implementations§
impl !Freeze for WatchRegistry
impl !RefUnwindSafe for WatchRegistry
impl Send for WatchRegistry
impl Sync for WatchRegistry
impl Unpin for WatchRegistry
impl UnwindSafe for WatchRegistry
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
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