An interface for the monitor service An implementation of this service is responsible for periodically checking various datasources to detect newly ingested ledgers.
More...
#include <MonitorInterface.hpp>
|
using | NewSequenceSignalType = boost::signals2::signal<void(uint32_t)> |
|
using | DbStalledSignalType = boost::signals2::signal<void()> |
|
|
virtual void | notifySequenceLoaded (uint32_t seq)=0 |
| Allows the loading process to notify of a freshly committed ledger.
|
|
virtual void | notifyWriteConflict (uint32_t seq)=0 |
| Notifies the monitor of a write conflict.
|
|
virtual boost::signals2::scoped_connection | subscribeToNewSequence (NewSequenceSignalType::slot_type const &subscriber)=0 |
| Allows clients to get notified when a new ledger becomes available in Clio's database.
|
|
virtual boost::signals2::scoped_connection | subscribeToDbStalled (DbStalledSignalType::slot_type const &subscriber)=0 |
| Allows clients to get notified when no database update is detected for a configured period.
|
|
virtual void | run (std::chrono::steady_clock::duration repeatInterval=kDEFAULT_REPEAT_INTERVAL)=0 |
| Run the monitor service.
|
|
virtual void | stop ()=0 |
| Stops the monitor service.
|
|
|
static constexpr auto | kDEFAULT_REPEAT_INTERVAL = std::chrono::seconds{1} |
|
An interface for the monitor service An implementation of this service is responsible for periodically checking various datasources to detect newly ingested ledgers.
◆ notifySequenceLoaded()
virtual void etlng::MonitorInterface::notifySequenceLoaded |
( |
uint32_t | seq | ) |
|
|
pure virtual |
Allows the loading process to notify of a freshly committed ledger.
- Parameters
-
seq | The ledger sequence loaded |
Implemented in etlng::impl::Monitor.
◆ notifyWriteConflict()
virtual void etlng::MonitorInterface::notifyWriteConflict |
( |
uint32_t | seq | ) |
|
|
pure virtual |
Notifies the monitor of a write conflict.
- Parameters
-
seq | The sequence number of the ledger that encountered a write conflict |
Implemented in etlng::impl::Monitor.
◆ run()
virtual void etlng::MonitorInterface::run |
( |
std::chrono::steady_clock::duration | repeatInterval = kDEFAULT_REPEAT_INTERVAL | ) |
|
|
pure virtual |
Run the monitor service.
- Parameters
-
repeatInterval | The interval between attempts to check the database for new ledgers |
Implemented in etlng::impl::Monitor.
◆ stop()
virtual void etlng::MonitorInterface::stop |
( |
| ) |
|
|
pure virtual |
◆ subscribeToDbStalled()
virtual boost::signals2::scoped_connection etlng::MonitorInterface::subscribeToDbStalled |
( |
DbStalledSignalType::slot_type const & | subscriber | ) |
|
|
nodiscardpure virtual |
Allows clients to get notified when no database update is detected for a configured period.
- Parameters
-
subscriber | The slot to connect |
- Returns
- A connection object that automatically disconnects the subscription once destroyed
Implemented in etlng::impl::Monitor.
◆ subscribeToNewSequence()
virtual boost::signals2::scoped_connection etlng::MonitorInterface::subscribeToNewSequence |
( |
NewSequenceSignalType::slot_type const & | subscriber | ) |
|
|
nodiscardpure virtual |
Allows clients to get notified when a new ledger becomes available in Clio's database.
- Parameters
-
subscriber | The slot to connect |
- Returns
- A connection object that automatically disconnects the subscription once destroyed
Implemented in etlng::impl::Monitor.
The documentation for this class was generated from the following file: