Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
etlng::impl::Monitor Class Reference
Inheritance diagram for etlng::impl::Monitor:
Collaboration diagram for etlng::impl::Monitor:

Public Member Functions

 Monitor (util::async::AnyExecutionContext ctx, std::shared_ptr< BackendInterface > backend, std::shared_ptr< etl::NetworkValidatedLedgersInterface > validatedLedgers, uint32_t startSequence, std::chrono::steady_clock::duration dbStalledReportDelay)
 
void notifySequenceLoaded (uint32_t seq) override
 Allows the loading process to notify of a freshly committed ledger.
 
void notifyWriteConflict (uint32_t seq) override
 Notifies the monitor of a write conflict.
 
void run (std::chrono::steady_clock::duration repeatInterval) override
 Run the monitor service.
 
void stop () override
 Stops the monitor service.
 
boost::signals2::scoped_connection subscribeToNewSequence (NewSequenceSignalType::slot_type const &subscriber) override
 Allows clients to get notified when a new ledger becomes available in Clio's database.
 
boost::signals2::scoped_connection subscribeToDbStalled (DbStalledSignalType::slot_type const &subscriber) override
 Allows clients to get notified when no database update is detected for a configured period.
 
- Public Member Functions inherited from etlng::MonitorInterface

Additional Inherited Members

- Public Types inherited from etlng::MonitorInterface
using NewSequenceSignalType = boost::signals2::signal<void(uint32_t)>
 
using DbStalledSignalType = boost::signals2::signal<void()>
 
- Static Public Attributes inherited from etlng::MonitorInterface
static constexpr auto kDEFAULT_REPEAT_INTERVAL = std::chrono::seconds{1}
 

Member Function Documentation

◆ notifySequenceLoaded()

void etlng::impl::Monitor::notifySequenceLoaded ( uint32_t seq)
overridevirtual

Allows the loading process to notify of a freshly committed ledger.

Parameters
seqThe ledger sequence loaded

Implements etlng::MonitorInterface.

◆ notifyWriteConflict()

void etlng::impl::Monitor::notifyWriteConflict ( uint32_t seq)
overridevirtual

Notifies the monitor of a write conflict.

Parameters
seqThe sequence number of the ledger that encountered a write conflict

Implements etlng::MonitorInterface.

◆ run()

void etlng::impl::Monitor::run ( std::chrono::steady_clock::duration repeatInterval)
overridevirtual

Run the monitor service.

Parameters
repeatIntervalThe interval between attempts to check the database for new ledgers

Implements etlng::MonitorInterface.

◆ stop()

void etlng::impl::Monitor::stop ( )
overridevirtual

Stops the monitor service.

Implements etlng::MonitorInterface.

◆ subscribeToDbStalled()

boost::signals2::scoped_connection etlng::impl::Monitor::subscribeToDbStalled ( DbStalledSignalType::slot_type const & subscriber)
overridevirtual

Allows clients to get notified when no database update is detected for a configured period.

Parameters
subscriberThe slot to connect
Returns
A connection object that automatically disconnects the subscription once destroyed

Implements etlng::MonitorInterface.

◆ subscribeToNewSequence()

boost::signals2::scoped_connection etlng::impl::Monitor::subscribeToNewSequence ( NewSequenceSignalType::slot_type const & subscriber)
overridevirtual

Allows clients to get notified when a new ledger becomes available in Clio's database.

Parameters
subscriberThe slot to connect
Returns
A connection object that automatically disconnects the subscription once destroyed

Implements etlng::MonitorInterface.


The documentation for this class was generated from the following files: