acq_task.h 657 B

1234567891011121314151617181920212223242526
  1. #ifndef FOUNDATION_IOTACQ_TASK_H
  2. #define FOUNDATION_IOTACQ_TASK_H
  3. #include <vendor_global.h>
  4. #include <settings/config_parser.h>
  5. #include <leoyun/yun_rpc.h>
  6. #include <unordered_map>
  7. #include <uv.h>
  8. namespace iot_acq {
  9. class AcqTask : public vendor::VendorIf {
  10. public:
  11. AcqTask();
  12. bool IsInRetry(int32_t times);
  13. void OnTimerTask();
  14. void PushRpc(const std::string &name, std::shared_ptr<leoyun::YunRpc> rpc);
  15. void ForEach(
  16. const std::function<void(const std::shared_ptr<leoyun::YunRpc> &)>
  17. &rpcCall);
  18. private:
  19. std::unordered_map<std::string, std::shared_ptr<leoyun::YunRpc> > mapRpc_;
  20. };
  21. } // namespace iot_acq
  22. #endif // FOUNDATION_IOTACQ_TASK_H