PageRenderTime 826ms CodeModel.GetById 694ms app.highlight 2ms RepoModel.GetById 129ms app.codeStats 0ms

/pool.h

http://github.com/nicolasff/webdis
C++ Header | 33 lines | 21 code | 12 blank | 0 comment | 0 complexity | 55de0383207068aeffba90298ca32ff8 MD5 | raw file
 1#ifndef POOL_H
 2#define POOL_H
 3
 4#include <hiredis/async.h>
 5
 6struct conf;
 7struct worker;
 8
 9struct pool {
10
11	struct worker *w;
12	struct conf *cfg;
13
14	const redisAsyncContext **ac;
15	int count;
16	int cur;
17
18};
19
20
21struct pool *
22pool_new(struct worker *w, int count);
23
24void
25pool_free_context(redisAsyncContext *ac);
26
27redisAsyncContext *
28pool_connect(struct pool *p, int db_num, int attach);
29
30const redisAsyncContext *
31pool_get_context(struct pool *p);
32
33#endif