[−][src]Struct rdkafka::producer::base_producer::ThreadedProducer
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]
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]
&self,
record: BaseRecord<'a, K, P, C::DeliveryOpaque>
) -> Result<(), (KafkaError, BaseRecord<'a, K, P, C::DeliveryOpaque>)> where
K: ToBytes,
P: ToBytes,
Sends a message to Kafka. See the documentation in BaseProducer
.
pub fn poll<T: Into<Timeout>>(&self, timeout: T)
[src]
Polls the internal producer. This is not normally required since the ThreadedProducer
had
a thread dedicated to calling poll
regularly.
pub fn flush<T: Into<Timeout>>(&self, timeout: T)
[src]
Flushes the producer. Should be called before termination.
pub fn in_flight_count(&self) -> i32
[src]
Returns the number of messages waiting to be sent, or send but not acknowledged yet.
Trait Implementations
impl<C: ProducerContext + 'static> Drop for ThreadedProducer<C>
[src]
impl FromClientConfig for ThreadedProducer<DefaultProducerContext>
[src]
fn from_config(
config: &ClientConfig
) -> KafkaResult<ThreadedProducer<DefaultProducerContext>>
[src]
config: &ClientConfig
) -> KafkaResult<ThreadedProducer<DefaultProducerContext>>
impl<C: ProducerContext + 'static> FromClientConfigAndContext<C> for ThreadedProducer<C>
[src]
fn from_config_and_context(
config: &ClientConfig,
context: C
) -> KafkaResult<ThreadedProducer<C>>
[src]
config: &ClientConfig,
context: C
) -> KafkaResult<ThreadedProducer<C>>
Auto Trait Implementations
impl<C> RefUnwindSafe for ThreadedProducer<C> where
C: RefUnwindSafe,
C: RefUnwindSafe,
impl<C> Send for ThreadedProducer<C>
impl<C> Sync for ThreadedProducer<C>
impl<C> Unpin for ThreadedProducer<C>
impl<C> UnwindSafe for ThreadedProducer<C> where
C: RefUnwindSafe,
C: RefUnwindSafe,
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>,