xrpld
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::node_store {
8
9enum class FetchType { Synchronous, Async };
10
24
35
46{
47public:
48 virtual ~Scheduler() = default;
49
56 virtual void
57 scheduleTask(Task& task) = 0;
58
63 virtual void
64 onFetch(FetchReport const& report) = 0;
65
70 virtual void
71 onBatchWrite(BatchWriteReport const& report) = 0;
72};
73
74} // namespace xrpl::node_store
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 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.
virtual ~Scheduler()=default
Contains information about a batch write operation.
Contains information about a fetch operation.
Derived classes perform scheduled tasks.
Definition Task.h:9