Kagome
Polkadot Runtime Engine in C++17
offchain_worker_pool_impl.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_OFFCHAIN_WORKER_POOL_IMPL_HPP
7 #define KAGOME_OFFCHAIN_WORKER_POOL_IMPL_HPP
8 
9 #include <thread>
10 
12 
13 #include "log/logger.hpp"
14 #include "utils/safe_object.hpp"
15 
16 namespace kagome::offchain {
18 
20  public:
22 
23  void addWorker(std::shared_ptr<OffchainWorker> ofw) override;
24 
25  std::optional<std::shared_ptr<OffchainWorker>> getWorker() const override;
26 
27  bool removeWorker() override;
28 
29  private:
31  SafeObject<
32  std::unordered_map<ThreadNumber, std::shared_ptr<OffchainWorker>>>
34  };
35 
36 } // namespace kagome::offchain
37 
38 #endif /* KAGOME_OFFCHAIN_WORKER_POOL_IMPL_HPP */
void addWorker(std::shared_ptr< OffchainWorker > ofw) override
std::shared_ptr< soralog::Logger > Logger
Definition: logger.hpp:23
size_t ThreadNumber
Definition: common.hpp:20
SafeObject< std::unordered_map< ThreadNumber, std::shared_ptr< OffchainWorker > > > offchain_workers_
std::optional< std::shared_ptr< OffchainWorker > > getWorker() const override