rippled
Loading...
Searching...
No Matches
include/xrpl/nodestore/Scheduler.h
1#pragma once
2
3#include <xrpl/nodestore/Task.h>
4
5#include <chrono>
6
7namespace xrpl {
8namespace NodeStore {
9
10enum class FetchType { synchronous, async };
11
14{
15 explicit FetchReport(FetchType fetchType_) : fetchType(fetchType_)
16 {
17 }
18
21 bool wasFound = false;
22};
23
32
42{
43public:
44 virtual ~Scheduler() = default;
45
51 virtual void
52 scheduleTask(Task& task) = 0;
53
57 virtual void
58 onFetch(FetchReport const& report) = 0;
59
63 virtual void
64 onBatchWrite(BatchWriteReport const& report) = 0;
65};
66
67} // namespace NodeStore
68} // namespace xrpl
Scheduling for asynchronous backend activity.
virtual void scheduleTask(Task &task)=0
Schedules a task.
virtual ~Scheduler()=default
virtual void onFetch(FetchReport const &report)=0
Reports completion of a fetch Allows the scheduler to monitor the node store's performance.
virtual void onBatchWrite(BatchWriteReport const &report)=0
Reports the completion of a batch write Allows the scheduler to monitor the node store's performance.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
Contains information about a batch write operation.
Contains information about a fetch operation.
Derived classes perform scheduled tasks.
Definition Task.h:8