10 using soralog::util::getThreadNumber;
13 : log_(log::
createLogger(
"OffchainWorkerPool",
"offchain")) {
19 offchain_workers.emplace(getThreadNumber(), std::move(ofw));
23 std::optional<std::shared_ptr<OffchainWorker>>
26 [](
auto const &offchain_workers)
27 -> std::optional<std::shared_ptr<OffchainWorker>> {
28 if (
auto it = offchain_workers.find(getThreadNumber());
29 it != offchain_workers.end())
37 return offchain_workers.erase(getThreadNumber()) == 1;
void addWorker(std::shared_ptr< OffchainWorker > ofw) override
SafeObject< std::unordered_map< ThreadNumber, std::shared_ptr< OffchainWorker > > > offchain_workers_
Logger createLogger(const std::string &tag)
std::optional< std::shared_ptr< OffchainWorker > > getWorker() const override
bool removeWorker() override