Struct nsq::consumer::Consumer [] [src]

pub struct Consumer { /* fields omitted */ }

Consumer represents a long-lived connection to an nsqd instance that can read messages and reply depending on a handler function.

Methods

impl Consumer
[src]

Given a topic, channel, and config, set up a new Consumer instance.

Connect to a single nsqd instance supplied with a host and port.

Add a handler for messages that are consumed.

Start consuming from nsqd by initiating an event loop. This function moves the consumer to take ownership of the internal connection.