PageRenderTime 51ms CodeModel.GetById 30ms app.highlight 2ms RepoModel.GetById 18ms app.codeStats 0ms

/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
 4#include <pthread.h>
 5
 6struct http_client;
 7struct pool;
 8
 9struct worker {
10
11	/* self */
12	pthread_t thread;
13	struct event_base *base;
14
15	/* connection dispatcher */
16	struct server *s;
17	int link[2];
18
19	/* Redis connection pool */
20	struct pool *pool;
21};
22
23struct worker *
24worker_new(struct server *s);
25
26void
27worker_start(struct worker *w);
28
29void
30worker_add_client(struct worker *w, struct http_client *c);
31
32void
33worker_monitor_input(struct http_client *c);
34
35void
36worker_can_read(int fd, short event, void *p);
37
38void
39worker_process_client(struct http_client *c);
40
41#endif