Simplified distributed block storage with strong consistency, like in Ceph
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

20 lines
444 B

  1. // Copyright (c) Vitaliy Filippov, 2019+
  2. // License: VNPL-1.0 or GNU GPL-2.0+ (see README.md for details)
  3. #pragma once
  4. #include "ringloop.h"
  5. class timerfd_interval
  6. {
  7. int wait_state;
  8. int timerfd;
  9. ring_loop_t *ringloop;
  10. ring_consumer_t consumer;
  11. std::function<void(void)> callback;
  12. public:
  13. timerfd_interval(ring_loop_t *ringloop, int seconds, std::function<void(void)> cb);
  14. ~timerfd_interval();
  15. void loop();
  16. };