pub struct SubscribleEventDelegate<I, A>(/* private fields */);Expand description
Used to enable an application to receive events about joins and leaves over a subscriber instead of a direct function call.
Implementations§
Source§impl<I, A> SubscribleEventDelegate<I, A>
impl<I, A> SubscribleEventDelegate<I, A>
Sourcepub fn unbounded() -> (Self, EventSubscriber<I, A>)
pub fn unbounded() -> (Self, EventSubscriber<I, A>)
Creates a new EventDelegate and unbounded subscriber.
Sourcepub fn bounded(capacity: usize) -> (Self, EventSubscriber<I, A>)
pub fn bounded(capacity: usize) -> (Self, EventSubscriber<I, A>)
Creates a new EventDelegate and bounded subscriber.
Care must be taken that events are processed in a timely manner from the channel, since this delegate will block until an event can be sent.
Trait Implementations§
Source§impl<I, A> EventDelegate for SubscribleEventDelegate<I, A>
impl<I, A> EventDelegate for SubscribleEventDelegate<I, A>
Source§async fn notify_join(&self, node: Arc<NodeState<Self::Id, Self::Address>>)
async fn notify_join(&self, node: Arc<NodeState<Self::Id, Self::Address>>)
Invoked when a node is detected to have joined the cluster
Source§async fn notify_leave(&self, node: Arc<NodeState<Self::Id, Self::Address>>)
async fn notify_leave(&self, node: Arc<NodeState<Self::Id, Self::Address>>)
Invoked when a node is detected to have left the cluster
Auto Trait Implementations§
impl<I, A> Freeze for SubscribleEventDelegate<I, A>
impl<I, A> RefUnwindSafe for SubscribleEventDelegate<I, A>
impl<I, A> Send for SubscribleEventDelegate<I, A>
impl<I, A> Sync for SubscribleEventDelegate<I, A>
impl<I, A> Unpin for SubscribleEventDelegate<I, A>
impl<I, A> UnsafeUnpin for SubscribleEventDelegate<I, A>
impl<I, A> UnwindSafe for SubscribleEventDelegate<I, A>
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more