|
relx 0.1.0
A Modern C++23 Type-Safe SQL Query Builder
|
Async streaming result set that yields rows asynchronously. More...
#include <relx/connection/postgresql_async_streaming_source.hpp>
Classes | |
| class | async_streaming_iterator |
| Iterator that reads data on demand asynchronously. More... | |
Public Member Functions | |
| AsyncStreamingResultSet (DataSource source) | |
| ~AsyncStreamingResultSet () | |
| Destructor that ensures cleanup when result set goes out of scope. | |
| AsyncStreamingResultSet (const AsyncStreamingResultSet &)=delete | |
| AsyncStreamingResultSet & | operator= (const AsyncStreamingResultSet &)=delete |
| AsyncStreamingResultSet (AsyncStreamingResultSet &&other) noexcept | |
| AsyncStreamingResultSet & | operator= (AsyncStreamingResultSet &&other) noexcept |
| async_streaming_iterator | begin () |
| Begin async iteration. | |
| async_streaming_iterator | end () |
| End marker for async iteration. | |
| template<typename Func > | |
| boost::asio::awaitable< void > | for_each (Func &&func) |
| Process all rows with an async callback. | |
| boost::asio::awaitable< void > | cleanup () |
| Explicitly cleanup the streaming source. | |
| boost::asio::awaitable< void > | auto_reset_connection_state () |
| Internal method to automatically reset connection state (called only once) | |
Async streaming result set that yields rows asynchronously.
Definition at line 126 of file postgresql_async_streaming_source.hpp.
|
inline |
Definition at line 163 of file postgresql_async_streaming_source.hpp.
|
inline |
Destructor that ensures cleanup when result set goes out of scope.
Definition at line 166 of file postgresql_async_streaming_source.hpp.
|
delete |
|
inlinenoexcept |
Definition at line 182 of file postgresql_async_streaming_source.hpp.
|
inline |
Internal method to automatically reset connection state (called only once)
Definition at line 344 of file postgresql_async_streaming_source.hpp.
|
inline |
Begin async iteration.
Definition at line 205 of file postgresql_async_streaming_source.hpp.
|
inline |
Explicitly cleanup the streaming source.
Definition at line 337 of file postgresql_async_streaming_source.hpp.
|
inline |
End marker for async iteration.
Definition at line 208 of file postgresql_async_streaming_source.hpp.
|
inline |
Process all rows with an async callback.
This method is the recommended way to iterate over async streaming results.
Why for_each is needed instead of range-based for loops:
Async streaming cannot use standard C++ range-based for loops because:
operator++()advance() method returns boost::asio::awaitable<void>Usage Examples:
Manual Iteration (for finer-grained control):
If you need more control over the iteration process, you can use manual iteration:
| Func | Function type - can be sync/async, void/bool return |
| func | Callback function to process each row
|
Definition at line 286 of file postgresql_async_streaming_source.hpp.
|
inlinenoexcept |
Definition at line 187 of file postgresql_async_streaming_source.hpp.
|
delete |