pub struct OnBackoff;
Expand description
Sent by Connection after Backoff state is activated
§Examples
use actix::prelude::*;
use nsq_client::{Connection, Subscribe, OnBackoff};
struct Consumer(pub Addr<Connection>);
impl Actor for Consumer {
type Context = Context<Self>;
fn started(&mut self, ctx: &mut Self::Context) {
self.subscribe::<OnBackoff>(ctx, self.0.clone());
}
}
impl Handler<OnBackoff> for Consumer {
type Result = ();
fn handle(&mut self, msg: OnBackoff, ctx: &mut Self::Conetxt) {
println!("connection backoff activated");
}
}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OnBackoff
impl RefUnwindSafe for OnBackoff
impl Send for OnBackoff
impl Sync for OnBackoff
impl Unpin for OnBackoff
impl UnwindSafe for OnBackoff
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