Server_Connection that automatically reconnects on error
More...
#include <joedb/concurrency/Robust_Connection.h>
|
| | Robust_Connection (const Connector &connector, Logger &logger) |
| Channel & | get_channel () |
| 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.
|
| void | check_matching_content (const Readonly_Journal &client_journal, Content_Check content_check, int64_t from, int64_t until) override |
| | Compare content of file and connection. Throw if mismatch.
|
| 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 | ping () |
| void | unlock () override |
| | Unlock the connection.
|
| bool | is_pullonly () const override |
| virtual | ~Connection () |
|
| static Connection | dummy |
| | Since this class has no internal state, this global variable can be used instead of creating an instance.
|
| static void | content_mismatch () |
| | Called by handshake when the file and the connection do not match.
|
Definition at line 13 of file Robust_Connection.h.
◆ Robust_Connection()
| joedb::Robust_Connection::Robust_Connection |
( |
const Connector & | connector, |
|
|
Logger & | logger ) |
|
inline |
◆ check_matching_content()
| void joedb::Robust_Connection::check_matching_content |
( |
const Readonly_Journal & | client_journal, |
|
|
Content_Check | content_check, |
|
|
int64_t | from, |
|
|
int64_t | until ) |
|
overridevirtual |
◆ get_channel()
| Channel & joedb::Robust_Connection::get_channel |
( |
| ) |
|
|
inline |
◆ handshake()
◆ is_pullonly()
| bool joedb::Robust_Connection::is_pullonly |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ ping()
| void joedb::Robust_Connection::ping |
( |
| ) |
|
◆ pread()
| size_t joedb::Robust_Connection::pread |
( |
char * | data, |
|
|
size_t | size, |
|
|
int64_t | offset ) const |
◆ 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 |
- Returns
- connection checkpoint
Reimplemented from joedb::Connection.
Reimplemented in joedb::Server_File.
Definition at line 85 of file Robust_Connection.cpp.
◆ push()
◆ reconnect()
| void joedb::Robust_Connection::reconnect |
( |
const std::exception * | e | ) |
const |
|
protected |
◆ try_until_success()
template<typename F>
| auto joedb::Robust_Connection::try_until_success |
( |
const F & | f | ) |
const |
|
inlineprotected |
◆ unlock()
| void joedb::Robust_Connection::unlock |
( |
| ) |
|
|
overridevirtual |
◆ connection
The documentation for this class was generated from the following files: