/worker.h

http://github.com/nicolasff/webdis · C Header · 41 lines · 25 code · 13 blank · 3 comment · 0 complexity · e8270ced7c94859d968cd87beee80895 MD5 · raw file

  1. #ifndef WORKER_H
  2. #define WORKER_H
  3. #include <pthread.h>
  4. struct http_client;
  5. struct pool;
  6. struct worker {
  7. /* self */
  8. pthread_t thread;
  9. struct event_base *base;
  10. /* connection dispatcher */
  11. struct server *s;
  12. int link[2];
  13. /* Redis connection pool */
  14. struct pool *pool;
  15. };
  16. struct worker *
  17. worker_new(struct server *s);
  18. void
  19. worker_start(struct worker *w);
  20. void
  21. worker_add_client(struct worker *w, struct http_client *c);
  22. void
  23. worker_monitor_input(struct http_client *c);
  24. void
  25. worker_can_read(int fd, short event, void *p);
  26. void
  27. worker_process_client(struct http_client *c);
  28. #endif