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