f00966aa83ee50d515863c192a4647edd9db1e43
[awesomized/libmemcached] / libmemcached / util / pool.h
1 /* LibMemcached
2 * Copyright (C) 2006-2009 Brian Aker
3 * All rights reserved.
4 *
5 * Use and distribution licensed under the BSD license. See
6 * the COPYING file in the parent directory for full text.
7 *
8 * Summary: Connection pool implementation for libmemcached.
9 *
10 */
11
12
13 #ifndef __LIMEMCACHED_UTIL_POOL_H__
14 #define __LIMEMCACHED_UTIL_POOL_H__
15
16 #include <libmemcached/memcached.h>
17
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21
22 struct memcached_pool_st;
23 typedef struct memcached_pool_st memcached_pool_st;
24
25 LIBMEMCACHED_API
26 memcached_pool_st *memcached_pool_create(memcached_st* mmc, uint32_t initial, uint32_t max);
27
28 LIBMEMCACHED_API
29 memcached_pool_st *memcached_pool(const char *option_string, size_t option_string_length);
30
31 LIBMEMCACHED_API
32 memcached_st* memcached_pool_destroy(memcached_pool_st* pool);
33
34 LIBMEMCACHED_API
35 memcached_st* memcached_pool_pop(memcached_pool_st* pool,
36 bool block,
37 memcached_return_t* rc);
38 LIBMEMCACHED_API
39 memcached_return_t memcached_pool_push(memcached_pool_st* pool,
40 memcached_st* mmc);
41
42 LIBMEMCACHED_API
43 memcached_return_t memcached_pool_behavior_set(memcached_pool_st *ptr,
44 memcached_behavior_t flag,
45 uint64_t data);
46 LIBMEMCACHED_API
47 memcached_return_t memcached_pool_behavior_get(memcached_pool_st *ptr,
48 memcached_behavior_t flag,
49 uint64_t *value);
50
51 #ifdef __cplusplus
52 } // extern "C"
53 #endif
54
55 #endif /* __LIMEMCACHED_UTIL_POOL_H__ */