Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
MonitorProviderInterface.hpp
1#pragma once
2
3#include "data/BackendInterface.hpp"
4#include "etl/MonitorInterface.hpp"
6#include "util/async/AnyExecutionContext.hpp"
7
8#include <chrono>
9#include <cstdint>
10#include <memory>
11
12namespace etl {
13
21 static constexpr auto kDEFAULT_DB_STALLED_REPORT_DELAY = std::chrono::seconds{10};
22
23 virtual ~MonitorProviderInterface() = default;
24
35 [[nodiscard]] virtual std::unique_ptr<MonitorInterface>
38 std::shared_ptr<BackendInterface> backend,
39 std::shared_ptr<NetworkValidatedLedgersInterface> validatedLedgers,
40 uint32_t startSequence,
41 std::chrono::steady_clock::duration dbStalledReportDelay = kDEFAULT_DB_STALLED_REPORT_DELAY
42 ) = 0;
43};
44
45} // namespace etl
A type-erased execution context.
Definition AnyExecutionContext.hpp:22
An interface for providing Monitor instances.
Definition MonitorProviderInterface.hpp:17
virtual std::unique_ptr< MonitorInterface > make(util::async::AnyExecutionContext ctx, std::shared_ptr< BackendInterface > backend, std::shared_ptr< NetworkValidatedLedgersInterface > validatedLedgers, uint32_t startSequence, std::chrono::steady_clock::duration dbStalledReportDelay=kDEFAULT_DB_STALLED_REPORT_DELAY)=0
Create a new Monitor instance.
static constexpr auto kDEFAULT_DB_STALLED_REPORT_DELAY
The time Monitor should wait before reporting absence of updates to the database.
Definition MonitorProviderInterface.hpp:21