Kagome
Polkadot Runtime Engine in C++17
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
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
11
#include "
offchain/offchain_worker_pool.hpp
"
12
13
#include "
log/logger.hpp
"
14
#include "
utils/safe_object.hpp
"
15
16
namespace
kagome::offchain
{
17
using
kagome::primitives::ThreadNumber
;
18
19
class
OffchainWorkerPoolImpl
final :
public
OffchainWorkerPool
{
20
public
:
21
OffchainWorkerPoolImpl
();
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
:
30
log::Logger
log_
;
31
SafeObject
<
32
std::unordered_map<ThreadNumber, std::shared_ptr<OffchainWorker>>>
33
offchain_workers_
;
34
};
35
36
}
// namespace kagome::offchain
37
38
#endif
/* KAGOME_OFFCHAIN_WORKER_POOL_IMPL_HPP */
kagome::offchain::OffchainWorkerPoolImpl::OffchainWorkerPoolImpl
OffchainWorkerPoolImpl()
Definition:
offchain_worker_pool_impl.cpp:12
kagome::offchain
Definition:
host_api_factory_impl.hpp:20
kagome::offchain::OffchainWorkerPoolImpl::addWorker
void addWorker(std::shared_ptr< OffchainWorker > ofw) override
Definition:
offchain_worker_pool_impl.cpp:17
safe_object.hpp
logger.hpp
kagome::offchain::OffchainWorkerPool
Definition:
offchain_worker_pool.hpp:7
kagome::log::Logger
std::shared_ptr< soralog::Logger > Logger
Definition:
logger.hpp:23
kagome::primitives::ThreadNumber
size_t ThreadNumber
Definition:
common.hpp:20
kagome::offchain::OffchainWorkerPoolImpl
Definition:
offchain_worker_pool_impl.hpp:19
offchain_worker_pool.hpp
kagome::offchain::OffchainWorkerPoolImpl::log_
log::Logger log_
Definition:
offchain_worker_pool_impl.hpp:30
SafeObject
Definition:
safe_object.hpp:38
kagome::offchain::OffchainWorkerPoolImpl::offchain_workers_
SafeObject< std::unordered_map< ThreadNumber, std::shared_ptr< OffchainWorker > > > offchain_workers_
Definition:
offchain_worker_pool_impl.hpp:33
kagome::offchain::OffchainWorkerPoolImpl::getWorker
std::optional< std::shared_ptr< OffchainWorker > > getWorker() const override
Definition:
offchain_worker_pool_impl.cpp:24
kagome::offchain::OffchainWorkerPoolImpl::removeWorker
bool removeWorker() override
Definition:
offchain_worker_pool_impl.cpp:35
core
offchain
impl
offchain_worker_pool_impl.hpp
Generated by
1.8.11