5 #include <Poco/AtomicCounter.h>
6 #include <Poco/Event.h>
7 #include <Poco/Mutex.h>
8 #include <Poco/Timespan.h>
10 #include "loop/StoppableRunnable.h"
11 #include "util/AsyncExecutor.h"
12 #include "util/Loggable.h"
21 typedef Poco::SharedPtr<SequentialAsyncExecutor> Ptr;
26 void setStopTimeout(
const Poco::Timespan &timeout);
28 void invoke(std::function<
void()> f)
override;
37 void execute(std::function<
void()> task);
38 std::queue<std::function<void()>> m_taskQueue;
39 Poco::Event m_wakeupEvent;
40 Poco::FastMutex m_queueMutex;
41 Poco::AtomicCounter m_stopRequested;
42 Poco::Event m_stoppedEvent;
43 Poco::Timespan m_stopTimeout;
Definition: SequentialAsyncExecutor.h:16
Definition: AsyncExecutor.h:12
void invoke(std::function< void()> f) override
Definition: SequentialAsyncExecutor.cpp:45
void stop() override
Definition: SequentialAsyncExecutor.cpp:114
Definition: Loggable.h:19
Definition: StoppableRunnable.h:8