Clio
develop
The XRP Ledger API server.
Theme:
Default
Round
Robot
Toggle main menu visibility
Loading...
Searching...
No Matches
TaskManagerProvider.hpp
1
#pragma once
2
3
#include "etl/ExtractorInterface.hpp"
4
#include "etl/LoaderInterface.hpp"
5
#include "etl/MonitorInterface.hpp"
6
#include "
etl/NetworkValidatedLedgersInterface.hpp
"
7
#include "etl/TaskManagerInterface.hpp"
8
#include "etl/TaskManagerProviderInterface.hpp"
9
#include "etl/impl/Scheduling.hpp"
10
#include "etl/impl/TaskManager.hpp"
11
#include "util/async/AnyExecutionContext.hpp"
12
13
#include <cstdint>
14
#include <functional>
15
#include <memory>
16
#include <optional>
17
#include <utility>
18
19
namespace
etl::impl {
20
24
class
TaskManagerProvider
:
public
TaskManagerProviderInterface
{
25
std::reference_wrapper<NetworkValidatedLedgersInterface> ledgers_;
26
std::shared_ptr<ExtractorInterface> extractor_;
27
std::shared_ptr<LoaderInterface> loader_;
28
29
public
:
37
TaskManagerProvider
(
38
std::reference_wrapper<NetworkValidatedLedgersInterface> ledgers,
39
std::shared_ptr<ExtractorInterface> extractor,
40
std::shared_ptr<LoaderInterface> loader
41
)
42
: ledgers_(ledgers), extractor_(std::move(extractor)), loader_(std::move(loader))
43
{
44
}
45
46
std::unique_ptr<TaskManagerInterface>
47
make
(
48
util::async::AnyExecutionContext
ctx,
49
std::reference_wrapper<MonitorInterface> monitor,
50
uint32_t startSeq,
51
std::optional<uint32_t> finishSeq
52
)
override
53
{
54
auto
scheduler = impl::makeScheduler(
impl::ForwardScheduler
{ledgers_, startSeq, finishSeq});
55
// TODO: add impl::BackfillScheduler{startSeq - 1, startSeq - ...},
56
57
return
std::make_unique<TaskManager>(
58
std::move(ctx), std::move(scheduler), *extractor_, *loader_, monitor, startSeq
59
);
60
}
61
};
62
63
}
// namespace etl::impl
NetworkValidatedLedgersInterface.hpp
etl::impl::ForwardScheduler
Definition
Scheduling.hpp:24
etl::impl::TaskManagerProvider::make
std::unique_ptr< TaskManagerInterface > make(util::async::AnyExecutionContext ctx, std::reference_wrapper< MonitorInterface > monitor, uint32_t startSeq, std::optional< uint32_t > finishSeq) override
Make a task manager.
Definition
TaskManagerProvider.hpp:47
etl::impl::TaskManagerProvider::TaskManagerProvider
TaskManagerProvider(std::reference_wrapper< NetworkValidatedLedgersInterface > ledgers, std::shared_ptr< ExtractorInterface > extractor, std::shared_ptr< LoaderInterface > loader)
Constructor.
Definition
TaskManagerProvider.hpp:37
util::async::AnyExecutionContext
A type-erased execution context.
Definition
AnyExecutionContext.hpp:23
etl::TaskManagerProviderInterface
An interface for providing the Task Manager.
Definition
TaskManagerProviderInterface.hpp:18
src
etl
impl
TaskManagerProvider.hpp
Generated by
1.17.0