Struct rdkafka::producer::ThreadedProducer [−][src]
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]
C: ProducerContext + 'static,
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 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]
C: ProducerContext + 'static,
impl FromClientConfig for ThreadedProducer<DefaultProducerContext>
[src]
fn from_config(
config: &ClientConfig
) -> KafkaResult<ThreadedProducer<DefaultProducerContext>>
[src]
config: &ClientConfig
) -> KafkaResult<ThreadedProducer<DefaultProducerContext>>
impl<C> FromClientConfigAndContext<C> for ThreadedProducer<C> where
C: ProducerContext + 'static,
[src]
C: ProducerContext + 'static,
fn from_config_and_context(
config: &ClientConfig,
context: C
) -> KafkaResult<ThreadedProducer<C>>
[src]
config: &ClientConfig,
context: C
) -> KafkaResult<ThreadedProducer<C>>
impl<C> Producer<C> for ThreadedProducer<C> where
C: ProducerContext + 'static,
[src]
C: ProducerContext + 'static,
fn client(&self) -> &Client<C>
[src]
fn flush<T: Into<Timeout>>(&self, timeout: T)
[src]
fn in_flight_count(&self) -> i32
[src]
fn init_transactions<T: Into<Timeout>>(&self, timeout: T) -> KafkaResult<()>
[src]
fn begin_transaction(&self) -> KafkaResult<()>
[src]
fn send_offsets_to_transaction<T: Into<Timeout>>(
&self,
offsets: &TopicPartitionList,
cgm: &ConsumerGroupMetadata,
timeout: T
) -> KafkaResult<()>
[src]
&self,
offsets: &TopicPartitionList,
cgm: &ConsumerGroupMetadata,
timeout: T
) -> KafkaResult<()>
fn commit_transaction<T: Into<Timeout>>(&self, timeout: T) -> KafkaResult<()>
[src]
fn abort_transaction<T: Into<Timeout>>(&self, timeout: T) -> KafkaResult<()>
[src]
fn context(&self) -> &Arc<C>
[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]
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,
pub 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.
pub 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>,