Server_Connection that automatically reconnects on error
More...
#include <joedb/concurrency/Robust_Connection.h>
|
| Robust_Connection (const Connector &connector, std::ostream *log) |
|
size_t | pread (char *data, size_t size, int64_t offset) const |
|
int64_t | handshake (const Readonly_Journal &client_journal, Content_Check content_check) override |
| Called during Client construction.
|
|
int64_t | pull (Lock_Action lock_action, Data_Transfer data_transfer, Writable_Journal &client_journal, std::chrono::milliseconds wait) override |
| Pull from the connection.
|
|
int64_t | push (const Readonly_Journal &client_journal, int64_t from_checkpoint, int64_t until_checkpoint, Unlock_Action unlock_action) override |
| Push new data to the connection.
|
|
void | unlock () override |
| Unlock the connection.
|
|
virtual | ~Connection () |
|
Definition at line 14 of file Robust_Connection.h.
◆ Robust_Connection()
joedb::Robust_Connection::Robust_Connection |
( |
const Connector & |
connector, |
|
|
std::ostream * |
log |
|
) |
| |
|
inline |
◆ handshake()
◆ pread()
size_t joedb::Robust_Connection::pread |
( |
char * |
data, |
|
|
size_t |
size, |
|
|
int64_t |
offset |
|
) |
| const |
|
inline |
◆ pull()
- Parameters
-
lock_action | whether the connection should be locked before pulling |
data_transfer | whether data should be transferred |
client_journal | journal to pull into |
wait | duration during which the connection may wait for new data if the pull would otherwise be empty |
- Return values
-
Reimplemented from joedb::Connection.
Reimplemented in joedb::Server_File.
Definition at line 113 of file Robust_Connection.h.
◆ push()
◆ reconnect()
void joedb::Robust_Connection::reconnect |
( |
const std::exception * |
e | ) |
const |
|
inlineprotected |
◆ try_until_success()
template<typename F >
auto joedb::Robust_Connection::try_until_success |
( |
const F & |
f | ) |
const |
|
inlineprotected |
◆ unlock()
void joedb::Robust_Connection::unlock |
( |
| ) |
|
|
inlineoverridevirtual |
◆ connection
The documentation for this class was generated from the following file: