#include <TaskRunner.hpp>
Classes | |
| struct | TaskState |
Public Member Functions | |
| ~TaskRunner () | |
| void | every (const std::string &name, std::chrono::milliseconds interval, std::function< void()> fn) |
| bool | stop_task (const std::string &name) |
| bool | has_task (const std::string &name) const |
| void | stop () |
Private Attributes | |
| std::mutex | mutex_ |
| std::unordered_map< std::string, std::unique_ptr< TaskState > > | tasks_ |
| std::atomic_bool | shutdown_ {false} |
Definition at line 13 of file TaskRunner.hpp.
| bsc::task::TaskRunner::~TaskRunner | ( | ) |
| void bsc::task::TaskRunner::every | ( | const std::string & | name, |
| std::chrono::milliseconds | interval, | ||
| std::function< void()> | fn ) |
Definition at line 9 of file TaskRunner.cpp.
References mutex_, shutdown_, stop_task(), and tasks_.
Referenced by bsc::service::DaemonService::run().
| bool bsc::task::TaskRunner::has_task | ( | const std::string & | name | ) | const |
| void bsc::task::TaskRunner::stop | ( | ) |
Definition at line 49 of file TaskRunner.cpp.
References _, mutex_, shutdown_, and tasks_.
Referenced by ~TaskRunner().
| bool bsc::task::TaskRunner::stop_task | ( | const std::string & | name | ) |
Definition at line 30 of file TaskRunner.cpp.
References mutex_, and tasks_.
Referenced by every().
|
mutableprivate |
Definition at line 30 of file TaskRunner.hpp.
Referenced by every(), has_task(), stop(), and stop_task().
|
private |
Definition at line 32 of file TaskRunner.hpp.
|
private |
Definition at line 31 of file TaskRunner.hpp.
Referenced by every(), has_task(), stop(), and stop_task().