22#include "data/BackendInterface.hpp"
23#include "etl/MonitorInterface.hpp"
25#include "util/Mutex.hpp"
26#include "util/async/AnyExecutionContext.hpp"
27#include "util/async/AnyOperation.hpp"
28#include "util/async/AnyStrand.hpp"
29#include "util/log/Logger.hpp"
31#include <boost/signals2/connection.hpp>
32#include <xrpl/protocol/TxFormats.h>
45 std::shared_ptr<BackendInterface> backend_;
46 std::shared_ptr<NetworkValidatedLedgersInterface> validatedLedgers_;
48 std::atomic_uint32_t nextSequence_;
49 std::optional<util::async::AnyOperation<void>> repeatedTask_;
50 std::optional<boost::signals2::scoped_connection>
53 NewSequenceSignalType notificationChannel_;
54 DbStalledSignalType dbStalledChannel_;
57 std::chrono::steady_clock::duration dbStalledReportDelay;
58 std::chrono::steady_clock::time_point lastDbCheckTime;
59 uint32_t lastSeenMaxSeqInDb = 0u;
69 std::shared_ptr<BackendInterface> backend,
70 std::shared_ptr<NetworkValidatedLedgersInterface> validatedLedgers,
71 uint32_t startSequence,
72 std::chrono::steady_clock::duration dbStalledReportDelay
83 run(std::chrono::steady_clock::duration repeatInterval)
override;
88 boost::signals2::scoped_connection
91 boost::signals2::scoped_connection
96 onNextSequence(uint32_t seq);
An interface for the monitor service An implementation of this service is responsible for periodicall...
Definition MonitorInterface.hpp:36
void run(std::chrono::steady_clock::duration repeatInterval) override
Run the monitor service.
Definition Monitor.cpp:86
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.
Definition Monitor.cpp:122
void stop() override
Stops the monitor service.
Definition Monitor.cpp:106
void notifyWriteConflict(uint32_t seq) override
Notifies the monitor of a write conflict.
Definition Monitor.cpp:77
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.
Definition Monitor.cpp:116
void notifySequenceLoaded(uint32_t seq) override
Allows the loading process to notify of a freshly committed ledger.
Definition Monitor.cpp:65
A simple thread-safe logger for the channel specified in the constructor.
Definition Logger.hpp:96
A container for data that is protected by a mutex. Inspired by Mutex in Rust.
Definition Mutex.hpp:101
A type-erased execution context.
Definition AnyExecutionContext.hpp:41
A type-erased execution context.
Definition AnyStrand.hpp:40