#include <userver/ydb/topic.hpp>
Producer used to write messages to a topic.
Public Member Functions | |
| NYdb::NTopic::TWriteResult | Write (NYdb::NTopic::TWriteMessage &&message) |
| Write a single message to the topic. | |
| NYdb::NTopic::TFlushResult | Flush (engine::Deadline deadline={}) |
| Flush all buffered messages to the server. | |
| NYdb::NTopic::TCloseResult | Close (std::chrono::milliseconds timeout) |
| Close the producer. | |
| NYdb::NTopic::IProducer & | GetNativeTopicProducer () |
| Get native producer. | |
| NYdb::NTopic::TCloseResult ydb::TopicProducer::Close | ( | std::chrono::milliseconds | timeout | ) |
Close the producer.
Waits for all in-flight messages to be acknowledged. Force closes after timeout.
| NYdb::NTopic::TFlushResult ydb::TopicProducer::Flush | ( | engine::Deadline | deadline = {} | ) |
Flush all buffered messages to the server.
Waits until all in-flight messages are acknowledged.
| deadline | timeout for flush completion |
| NYdb::NTopic::IProducer & ydb::TopicProducer::GetNativeTopicProducer | ( | ) |
Get native producer.
| NYdb::NTopic::TWriteResult ydb::TopicProducer::Write | ( | NYdb::NTopic::TWriteMessage && | message | ) |
Write a single message to the topic.
Adds the message to the internal buffer and returns immediately. Use Flush() to wait for the buffered messages to be persistently written.