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::NodeStore {
8
9enum class FetchType { Synchronous, Async };
10
22
31
41{
42public:
43 virtual ~Scheduler() = default;
44
50 virtual void
51 scheduleTask(Task& task) = 0;
52
56 virtual void
57 onFetch(FetchReport const& report) = 0;
58
62 virtual void
63 onBatchWrite(BatchWriteReport const& report) = 0;
64};
65
66} // namespace xrpl::NodeStore
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.
Contains information about a batch write operation.
Contains information about a fetch operation.
Derived classes perform scheduled tasks.
Definition Task.h:7