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

#include <userver/ydb/topic.hpp>

Detailed Description

Read session used to connect to one or more topics for reading.

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

Example usage:

Topic reader

Definition at line 29 of file topic.hpp.

Public Member Functions

std::vector< NYdb::NTopic::TReadSessionEvent::TEvent > GetEvents (std::optional< std::size_t > max_events_count={})
 Get read session events.
 
bool Close (std::chrono::milliseconds timeout)
 Close read session.
 
std::shared_ptr< NYdb::NTopic::IReadSession > GetNativeTopicReadSession ()
 

Member Function Documentation

◆ Close()

bool ydb::TopicReadSession::Close ( std::chrono::milliseconds timeout)

Close read session.

Waits for all commit acknowledgments to arrive. Force close after timeout

◆ GetEvents()

std::vector< NYdb::NTopic::TReadSessionEvent::TEvent > ydb::TopicReadSession::GetEvents ( std::optional< std::size_t > max_events_count = {})

Get read session events.

Waits until event occurs

Parameters
max_events_countmaximum events count in batch if not specified, read session chooses event batch size automatically

◆ GetNativeTopicReadSession()

std::shared_ptr< NYdb::NTopic::IReadSession > ydb::TopicReadSession::GetNativeTopicReadSession ( )

Get native read session

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

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