Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
etl::MonitorInterface Class Referenceabstract

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>

Inheritance diagram for etl::MonitorInterface:

Public Types

using NewSequenceSignalType = boost::signals2::signal<void(uint32_t)>
 Signal fired with the sequence of each new ledger found in the database.
using DbStalledSignalType = boost::signals2::signal<void()>
 Signal fired when no database update is detected for a configured period.

Public Member Functions

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=kDefaultRepeatInterval)=0
 Run the monitor service.
virtual void stop ()=0
 Stops the monitor service.

Static Public Attributes

static constexpr auto kDefaultRepeatInterval = std::chrono::seconds{1}
 Default interval between checks of the database for new ledgers.

Detailed Description

An interface for the monitor service An implementation of this service is responsible for periodically checking various datasources to detect newly ingested ledgers.

Member Function Documentation

◆ notifySequenceLoaded()

virtual void etl::MonitorInterface::notifySequenceLoaded ( uint32_t seq)
pure virtual

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

Parameters
seqThe ledger sequence loaded

Implemented in etl::impl::Monitor.

◆ notifyWriteConflict()

virtual void etl::MonitorInterface::notifyWriteConflict ( uint32_t seq)
pure virtual

Notifies the monitor of a write conflict.

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

Implemented in etl::impl::Monitor.

◆ run()

virtual void etl::MonitorInterface::run ( std::chrono::steady_clock::duration repeatInterval = kDefaultRepeatInterval)
pure virtual

Run the monitor service.

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

Implemented in etl::impl::Monitor.

◆ stop()

virtual void etl::MonitorInterface::stop ( )
pure virtual

Stops the monitor service.

Implemented in etl::impl::Monitor.

◆ subscribeToDbStalled()

virtual boost::signals2::scoped_connection etl::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
subscriberThe slot to connect
Returns
A connection object that automatically disconnects the subscription once destroyed

Implemented in etl::impl::Monitor.

◆ subscribeToNewSequence()

virtual boost::signals2::scoped_connection etl::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
subscriberThe slot to connect
Returns
A connection object that automatically disconnects the subscription once destroyed

Implemented in etl::impl::Monitor.


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