Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
CacheLoaderDecider.hpp
1#pragma once
2
3#include "cluster/Backend.hpp"
4#include "cluster/ClioNode.hpp"
5#include "data/LedgerCacheLoadingState.hpp"
6
7#include <boost/asio/thread_pool.hpp>
8
9#include <memory>
10
11namespace cluster {
12
29 boost::asio::thread_pool& ctx_;
30
34 std::unique_ptr<data::LedgerCacheLoadingStateInterface> cacheLoadingState_;
35
36public:
44 boost::asio::thread_pool& ctx,
45 std::unique_ptr<data::LedgerCacheLoadingStateInterface> cacheLoadingState
46 );
47
61 void
62 onNewState(ClioNode::CUuid selfId, std::shared_ptr<Backend::ClusterData const> clusterData);
63};
64
65} // namespace cluster
void onNewState(ClioNode::CUuid selfId, std::shared_ptr< Backend::ClusterData const > clusterData)
Handles cluster state changes and decides whether this node should load the cache.
Definition CacheLoaderDecider.cpp:28
CacheLoaderDecider(boost::asio::thread_pool &ctx, std::unique_ptr< data::LedgerCacheLoadingStateInterface > cacheLoadingState)
Constructs a CacheLoaderDecider.
Definition CacheLoaderDecider.cpp:19