Clio
develop
The XRP Ledger API server.
Theme:
Default
Round
Robot
Toggle main menu visibility
Loading...
Searching...
No Matches
MonitorInterface.hpp
1
#pragma once
2
3
#include <boost/signals2/connection.hpp>
4
#include <boost/signals2/signal.hpp>
5
#include <boost/signals2/variadic_signal.hpp>
6
7
#include <chrono>
8
#include <cstdint>
9
10
namespace
etl
{
11
17
class
MonitorInterface
{
18
public
:
22
static
constexpr
auto
kDefaultRepeatInterval
= std::chrono::seconds{1};
26
using
NewSequenceSignalType
= boost::signals2::signal<void(uint32_t)>;
30
using
DbStalledSignalType
= boost::signals2::signal<void()>;
31
32
virtual
~MonitorInterface
() =
default
;
33
38
virtual
void
39
notifySequenceLoaded
(uint32_t seq) = 0;
40
45
virtual
void
46
notifyWriteConflict
(uint32_t seq) = 0;
47
54
[[nodiscard]]
virtual
boost::signals2::scoped_connection
55
subscribeToNewSequence
(NewSequenceSignalType::slot_type
const
& subscriber) = 0;
56
64
[[nodiscard]]
virtual
boost::signals2::scoped_connection
65
subscribeToDbStalled
(DbStalledSignalType::slot_type
const
& subscriber) = 0;
66
72
virtual
void
73
run
(std::chrono::steady_clock::duration repeatInterval =
kDefaultRepeatInterval
) = 0;
74
78
virtual
void
79
stop
() = 0;
80
};
81
82
}
// namespace etl
etl::MonitorInterface
An interface for the monitor service An implementation of this service is responsible for periodicall...
Definition
MonitorInterface.hpp:17
etl::MonitorInterface::subscribeToNewSequence
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.
etl::MonitorInterface::subscribeToDbStalled
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.
etl::MonitorInterface::NewSequenceSignalType
boost::signals2::signal< void(uint32_t)> NewSequenceSignalType
Signal fired with the sequence of each new ledger found in the database.
Definition
MonitorInterface.hpp:26
etl::MonitorInterface::kDefaultRepeatInterval
static constexpr auto kDefaultRepeatInterval
Default interval between checks of the database for new ledgers.
Definition
MonitorInterface.hpp:22
etl::MonitorInterface::notifySequenceLoaded
virtual void notifySequenceLoaded(uint32_t seq)=0
Allows the loading process to notify of a freshly committed ledger.
etl::MonitorInterface::notifyWriteConflict
virtual void notifyWriteConflict(uint32_t seq)=0
Notifies the monitor of a write conflict.
etl::MonitorInterface::stop
virtual void stop()=0
Stops the monitor service.
etl::MonitorInterface::run
virtual void run(std::chrono::steady_clock::duration repeatInterval=kDefaultRepeatInterval)=0
Run the monitor service.
etl::MonitorInterface::DbStalledSignalType
boost::signals2::signal< void()> DbStalledSignalType
Signal fired when no database update is detected for a configured period.
Definition
MonitorInterface.hpp:30
etl
This namespace contains everything to do with the ETL and ETL sources.
Definition
AmendmentBlockHandlerInterface.hpp:6
src
etl
MonitorInterface.hpp
Generated by
1.17.0