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.
 
 
 
 
 
 

24 lines
544 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 <map>
  5. #include "ringloop.h"
  6. #include "timerfd_manager.h"
  7. class epoll_manager_t
  8. {
  9. int epoll_fd;
  10. ring_loop_t *ringloop;
  11. std::map<int, std::function<void(int, int)>> epoll_handlers;
  12. public:
  13. epoll_manager_t(ring_loop_t *ringloop);
  14. ~epoll_manager_t();
  15. void set_fd_handler(int fd, bool wr, std::function<void(int, int)> handler);
  16. void handle_epoll_events();
  17. timerfd_manager_t *tfd;
  18. };