[−][src]Struct tokio_nsq::NSQProducer
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
impl NSQProducer
[src]
pub async fn consume<'_>(&'_ mut self) -> Option<NSQEvent>
[src]
Consume message acknowledgements, and connection status updates.
pub fn publish(
&mut self,
topic: &Arc<NSQTopic>,
value: Vec<u8>
) -> Result<(), Error>
[src]
&mut self,
topic: &Arc<NSQTopic>,
value: Vec<u8>
) -> Result<(), Error>
Queue a PUB message to be asynchronously sent
pub fn publish_deferred(
&mut self,
topic: &Arc<NSQTopic>,
value: Vec<u8>,
delay_milliseconds: u32
) -> Result<(), Error>
[src]
&mut self,
topic: &Arc<NSQTopic>,
value: Vec<u8>,
delay_milliseconds: u32
) -> Result<(), Error>
Queue a DPUB message to be asynchronously sent
pub fn publish_multiple(
&mut self,
topic: &Arc<NSQTopic>,
value: Vec<Vec<u8>>
) -> Result<(), Error>
[src]
&mut self,
topic: &Arc<NSQTopic>,
value: Vec<Vec<u8>>
) -> Result<(), Error>
Queue an MPUB 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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,