File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,6 +47,14 @@ class TopicReadSession final {
4747 size_t max_size_bytes = std::numeric_limits<size_t >::max()
4848 );
4949
50+ // / @brief Get read session events
51+ // /
52+ // / Waits until event occurs
53+ // / @param settings ydb native read session settings
54+ std::vector<NYdb::NTopic::TReadSessionEvent::TEvent> GetEvents (
55+ const NYdb::NTopic::TReadSessionGetEventSettings& settings
56+ );
57+
5058 // / @brief Close read session
5159 // /
5260 // / Waits for all commit acknowledgments to arrive.
Original file line number Diff line number Diff line change @@ -78,6 +78,12 @@ class Transaction final {
7878 ) noexcept ;
7979 // / @endcond
8080
81+ // / Get native transaction
82+ // / @warning Use with care! Facilities from
83+ // / `<core/include/userver/drivers/subscribable_futures.hpp>` can help with
84+ // / non-blocking wait operations.
85+ NYdb::TTransactionBase& GetNativeTransaction ();
86+
8187private:
8288 void MarkError () noexcept ;
8389 auto ErrorGuard ();
Original file line number Diff line number Diff line change @@ -25,6 +25,13 @@ std::vector<NYdb::NTopic::TReadSessionEvent::TEvent> TopicReadSession::GetEvents
2525 return read_session_->GetEvents (false , max_events_count, max_size_bytes);
2626}
2727
28+ std::vector<NYdb::NTopic::TReadSessionEvent::TEvent> TopicReadSession::GetEvents (
29+ const NYdb::NTopic::TReadSessionGetEventSettings& settings
30+ ) {
31+ impl::GetFutureValue (read_session_->WaitEvent ());
32+ return read_session_->GetEvents (settings);
33+ }
34+
2835bool TopicReadSession::Close (std::chrono::milliseconds timeout) { return read_session_->Close (timeout); }
2936
3037std::shared_ptr<NYdb::NTopic::IReadSession> TopicReadSession::GetNativeTopicReadSession () { return read_session_; }
Original file line number Diff line number Diff line change @@ -221,6 +221,10 @@ ExecuteResponse Transaction::Execute(
221221 return ExecuteResponse (std::move (status));
222222}
223223
224+ NYdb::TTransactionBase& Transaction::GetNativeTransaction () {
225+ return std::visit ([](auto & tx) -> NYdb::TTransactionBase& { return tx; }, ydb_tx_);
226+ }
227+
224228} // namespace ydb
225229
226230USERVER_NAMESPACE_END
You can’t perform that action at this time.
0 commit comments