19 #ifndef NAF_FUNCTIONS_CACHEACTION
20 #define NAF_FUNCTIONS_CACHEACTION
29 #include "functions/action.h"
30 #include "query/results.h"
32 #include "Poco/Exception.h"
33 #include "functions/action.h"
44 using namespace std::chrono_literals;
50 using Ptr = std::shared_ptr<CacheAction>;
52 CacheAction(std::string identifier, std::chrono::seconds update_time);
54 std::shared_ptr<std::thread> get_updates_thread()
const {
return updates_thread_; }
55 bool get_state()
const {
return state_; }
56 std::chrono::seconds get_update_time()
const {
return update_time_; }
58 void set_state(
bool state) { state_ = state; }
59 void set_update_time(std::chrono::seconds update_time) { update_time_ = update_time; }
61 virtual bool Work_()
override;
64 void WorkInBackground_();
67 std::shared_ptr<std::thread> updates_thread_;
69 std::chrono::seconds update_time_;
Definition: cache_action.h:48