Struct rdkafka::producer::BaseProducer
[−]
[src]
pub struct BaseProducer<C: ProducerContext> { /* fields omitted */ }
Simple Kafka producer. This producer needs to be poll
ed at regular intervals in order to
serve queued delivery report callbacks. This producer can be cheaply cloned to
create a new reference to the same underlying producer. Data production should be done using the
BaseProducerTopic
, that can be created from this producer.
Methods
impl<C: ProducerContext> BaseProducer<C>
[src]
fn get_topic(&self,
name: &str,
config: &TopicConfig)
-> KafkaResult<BaseProducerTopic<C>>
name: &str,
config: &TopicConfig)
-> KafkaResult<BaseProducerTopic<C>>
Returns a topic associated to the producer
fn poll(&self, timeout_ms: i32) -> i32
Polls the producer. Regular calls to poll
are required to process the evens
and execute the message delivery callbacks.
Trait Implementations
impl<C: ProducerContext> Clone for BaseProducer<C>
[src]
fn clone(&self) -> BaseProducer<C>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl FromClientConfig for BaseProducer<EmptyProducerContext>
[src]
fn from_config(config: &ClientConfig)
-> KafkaResult<BaseProducer<EmptyProducerContext>>
-> KafkaResult<BaseProducer<EmptyProducerContext>>
Creates a new BaseProducer
starting from a configuration.
impl<C: ProducerContext> FromClientConfigAndContext<C> for BaseProducer<C>
[src]
fn from_config_and_context(config: &ClientConfig,
context: C)
-> KafkaResult<BaseProducer<C>>
context: C)
-> KafkaResult<BaseProducer<C>>
Creates a new BaseProducer
starting from a configuration and a context.