userver: ydb::TopicProducer Class Reference
Loading...
Searching...
No Matches
ydb::TopicProducer Class Referencefinal

#include <userver/ydb/topic.hpp>

Detailed Description

Producer used to write messages to a topic.

See also
https://ydb.tech/docs/en/reference/ydb-sdk/topic#write

Definition at line 127 of file topic.hpp.

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.
 

Member Function Documentation

◆ Close()

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.

◆ Flush()

NYdb::NTopic::TFlushResult ydb::TopicProducer::Flush ( engine::Deadline deadline = {})

Flush all buffered messages to the server.

Waits until all in-flight messages are acknowledged.

Parameters
deadlinetimeout for flush completion

◆ GetNativeTopicProducer()

NYdb::NTopic::IProducer & ydb::TopicProducer::GetNativeTopicProducer ( )

Get native producer.

Warning
Use with care! Facilities from userver/drivers/subscribable_futures.hpp can help with non-blocking wait operations.

◆ Write()

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.


The documentation for this class was generated from the following file: