#include <userver/ydb/topic.hpp>
Write session used to connect to a topic for writting.
Public Member Functions | |
| NYdb::NTopic::TWriteSessionEvent::TEvent | GetEvent () |
| Wait for the next write session event. | |
| std::optional< NYdb::NTopic::TWriteSessionEvent::TEvent > | TryGetEvent () |
| Poll for a write session event without waiting. | |
| void | Write (NYdb::NTopic::TContinuationToken &&token, NYdb::NTopic::TWriteMessage &&message) |
| Write a messsage using a continuation token from TReadyToAcceptEvent. | |
| bool | Close (std::chrono::milliseconds timeout) |
| Close write session. | |
| NYdb::NTopic::IWriteSession & | GetNativeTopicWriteSession () |
| Get native write session. | |
| bool ydb::TopicWriteSession::Close | ( | std::chrono::milliseconds | timeout | ) |
Close write session.
Waits for all in-flights messages to be acknowledged. Force closes after timeout
| NYdb::NTopic::TWriteSessionEvent::TEvent ydb::TopicWriteSession::GetEvent | ( | ) |
Wait for the next write session event.
Suspends the current coroutine until an event is available, then returns it without blocking the thread.
| NYdb::NTopic::IWriteSession & ydb::TopicWriteSession::GetNativeTopicWriteSession | ( | ) |
Get native write session.
| std::optional< NYdb::NTopic::TWriteSessionEvent::TEvent > ydb::TopicWriteSession::TryGetEvent | ( | ) |
Poll for a write session event without waiting.
Returns the next buffered event immediately if one is available, or std::nullopt if the event queue is empty. Does not suspend the coroutine.
std::nullopt even if an event is available. Intended for use in loops. | void ydb::TopicWriteSession::Write | ( | NYdb::NTopic::TContinuationToken && | token, |
| NYdb::NTopic::TWriteMessage && | message ) |
Write a messsage using a continuation token from TReadyToAcceptEvent.
Must be called only after receiving TReadyToAcceptEvent from GetEvent() or TryGetEvent().