Struct fluvio::TopicProducer [−][src]
pub struct TopicProducer { /* fields omitted */ }
Expand description
An interface for producing events to a particular topic
A TopicProducer
allows you to send events to the specific
topic it was initialized for. Once you have a TopicProducer
,
you can send events to the topic, choosing which partition
each event should be delivered to.
Implementations
pub async fn send<K, V>(&self, key: K, value: V) -> Result<(), FluvioError> where
K: Into<RecordKey>,
V: Into<RecordData>,
pub async fn send<K, V>(&self, key: K, value: V) -> Result<(), FluvioError> where
K: Into<RecordKey>,
V: Into<RecordData>,
Sends a key/value record to this producer’s Topic.
The partition that the record will be sent to is derived from the Key.
Example
producer.send("Key", "Value").await?;
pub async fn send_all<K, V, I>(&self, records: I) -> Result<(), FluvioError> where
K: Into<RecordKey>,
V: Into<RecordData>,
I: IntoIterator<Item = (K, V)>,
Auto Trait Implementations
impl !RefUnwindSafe for TopicProducer
impl Send for TopicProducer
impl Sync for TopicProducer
impl Unpin for TopicProducer
impl !UnwindSafe for TopicProducer
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more