Struct rdkafka::producer::base_producer::ThreadedProducer[][src]

#[must_use = "The threaded producer will stop immediately if unused"]
pub struct ThreadedProducer<C: ProducerContext + 'static> { /* fields omitted */ }

A producer with a separate thread for event handling.

The ThreadedProducer is a BaseProducer with a separate thread dedicated to calling poll at regular intervals in order to execute any queued event, such as delivery notifications. The thread will be automatically stopped when the producer is dropped.

Methods

impl<C: ProducerContext + 'static> ThreadedProducer<C>
[src]

Sends a message to Kafka. See the documentation in BaseProducer.

Polls the internal producer. This is not normally required since the ThreadedProducer had a thread dedicated to calling poll regularly.

Flushes the producer. Should be called before termination.

Returns the number of messages waiting to be sent, or send but not acknowledged yet.

Trait Implementations

impl FromClientConfig for ThreadedProducer<DefaultProducerContext>
[src]

Create a client from client configuration. The default client context will be used.

impl<C: ProducerContext + 'static> FromClientConfigAndContext<C> for ThreadedProducer<C>
[src]

Create a client from client configuration and a client context.

impl<C: ProducerContext + 'static> Drop for ThreadedProducer<C>
[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

impl<C> Send for ThreadedProducer<C>

impl<C> Sync for ThreadedProducer<C>