# TimerWorker.hpp
This File On Github
Ask A Question
API: latest
module: oatpp
#include "oatpp/core/async/worker/TimerWorker.hpp"
# TimerWorker
Timer worker. Used to wait for timer-scheduled coroutines.
namespace oatpp { namespace async { namespace worker {
class TimerWorker : public Worker {}
}}}
# Methods
Return Type | Name | Summary |
---|---|---|
[none] | TimerWorker | Constructor. |
void | pushTasks | Push list of tasks to worker. |
void | pushOneTask | Push one task to worker. |
void | run | Run worker. |
void | stop | Break run loop. |
void | join | Join all worker-threads. |
void | detach | Detach all worker-threads. |
# TimerWorker::TimerWorker
Constructor.
- @param granularity - minimum possible time to wait.
TimerWorker(const std::chrono::duration<v_int64, std::micro>& granularity = std::chrono::milliseconds(100))
# TimerWorker::pushTasks
Push list of tasks to worker.
- @param tasks - oatpp::aysnc::utils::FastQueue of oatpp::async::CoroutineHandle.
void pushTasks(utils::FastQueue<CoroutineHandle>& tasks) override
# TimerWorker::pushOneTask
Push one task to worker.
- @param task - CoroutineHandle.
void pushOneTask(CoroutineHandle* task) override
# TimerWorker::run
Run worker.
void run()
# TimerWorker::stop
Break run loop.
void stop() override
# TimerWorker::join
Join all worker-threads.
void join() override
# TimerWorker::detach
Detach all worker-threads.
void detach() override