BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
NonAsyncExecutor.h
1 #pragma once
2 
3 #include "util/AsyncExecutor.h"
4 #include "util/Loggable.h"
5 #include "util/ThreadRecursionProtector.h"
6 
7 namespace BeeeOn {
8 
17 public:
18  typedef Poco::SharedPtr<NonAsyncExecutor> Ptr;
19 
20  void invoke(std::function<void()> f) override;
21 
22 private:
23  ThreadRecursionProtector m_protector;
24 };
25 
26 }
Definition: AsyncExecutor.h:12
Implementation of AsyncExecutor that executes the tasks directly in the current thread. Thus, the execution is in fact not asynchronous. The purpose of the NonAsyncExecutor is to provide a way how to deal with delegation of asynchronous processing (that is already in a separate thread) to another AsyncExecutor-based system.
Definition: NonAsyncExecutor.h:16
void invoke(std::function< void()> f) override
Definition: NonAsyncExecutor.cpp:8
ThreadRecursionProtector allows to prevent a recursive or repetitive execution of a code...
Definition: ThreadRecursionProtector.h:14
Definition: Loggable.h:19