pub struct Touch(pub String);
Expand description
Send TOUCH command to nsqd (reset timeout for and in-flight message)
Args:
- id - id of the message
§Examples
use actix::prelude::*;
use nsq_client::{Connection, Subscribe, Touch, Fin};
struct Consumer(pub Addr<Connection>);
impl Actor for Consumer {
type Context = Context<Self>;
fn started(&mut self, ctx: &mut Self::Context) {
self.subscribe::<Msg>(ctx, self.0.clone());
}
}
impl Handler<Msg> for Consumer {
type Result = ();
fn handle(&mut self, msg: Msg, ctx: &mut Self::Conetxt) {
self.0.do_send(Touch(msg.id));
}
}
Tuple Fields§
§0: String
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Touch
impl RefUnwindSafe for Touch
impl Send for Touch
impl Sync for Touch
impl Unpin for Touch
impl UnwindSafe for Touch
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