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
27 boost::asio::thread_pool& ctx_;
28
30 std::unique_ptr<data::LedgerCacheLoadingStateInterface> cacheLoadingState_;
31
32public:
40 boost::asio::thread_pool& ctx,
41 std::unique_ptr<data::LedgerCacheLoadingStateInterface> cacheLoadingState
42 );
43
57 void
58 onNewState(ClioNode::CUuid selfId, std::shared_ptr<Backend::ClusterData const> clusterData);
59};
60
61} // 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