Struct tokio_nsq::NSQProducer
source · [−]pub struct NSQProducer { /* private fields */ }
Expand description
An NSQD producer corresponding to a single instance.
Before any messages are published you must wait for an NSQEvent::Healthy()
message. If any messages are queued while the connection is unhealthy the
publish method shall return an error and the message will not be queued.
Messages are queued and delivered asynchronously. Once NSQ acknowledges a
message an NSQEvent::Ok()
will be available from consume
.
Multiple messages can be queued before any are acknowledged. You do not need
to wait on consume
immediately after each publish. If any
NSQEvent::Unhealthy()
event is ever returned, all unacknowledged messages
up to that point are now considered failed, and must be requeued. A producer
will not buffer messages waiting for a healthy connection.
Implementations
Consume message acknowledgements, and connection status updates.
Queue a PUB message to be asynchronously sent
Queue a DPUB message to be asynchronously sent
Auto Trait Implementations
impl !RefUnwindSafe for NSQProducer
impl Send for NSQProducer
impl Sync for NSQProducer
impl Unpin for NSQProducer
impl !UnwindSafe for NSQProducer
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more