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

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

A low-level Kafka 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 events, such as delivery notifications. The thread will be automatically stopped when the producer is dropped.

Implementations

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

pub fn send<'a, K: ?Sized, P: ?Sized>(
    &self,
    record: BaseRecord<'a, K, P, C::DeliveryOpaque>
) -> Result<(), (KafkaError, BaseRecord<'a, K, P, C::DeliveryOpaque>)> where
    K: ToBytes,
    P: ToBytes
[src]

Sends a message to Kafka.

See the documentation for BaseProducer::send for details.

pub fn poll<T: Into<Timeout>>(&self, timeout: T)[src]

Polls the internal producer.

This is not normally required since the ThreadedProducer has a thread dedicated to calling poll regularly.

Trait Implementations

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

impl FromClientConfig for ThreadedProducer<DefaultProducerContext>[src]

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

impl<C> Producer<C> for ThreadedProducer<C> where
    C: ProducerContext + 'static, 
[src]

Auto Trait Implementations

impl<C> !RefUnwindSafe for ThreadedProducer<C>

impl<C> Send for ThreadedProducer<C>

impl<C> Sync for ThreadedProducer<C>

impl<C> Unpin for ThreadedProducer<C>

impl<C> !UnwindSafe for ThreadedProducer<C>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.