1memcached_pool_create.pop(3) memcached_pool_creatememcached_pool_create.pop(3)
2
3
4

NAME

6       memcached_pool_create, memcached_pool_destroy, memcached_pool_push,
7       memcached_pool_pop - Manage pools
8

LIBRARY

10       C Client Library for memcached (libmemcachedutil, -lmemcachedutil)
11

SYNOPSIS

13         #include <libmemcached/memcached_pool.h>
14
15         memcached_pool_st *
16           memcached_pool_create(memcached_st* mmc, int initial, int max);
17
18         memcached_st *
19           memcached_pool_destroy(memcached_pool_st* pool);
20
21         memcached_st *
22           memcached_pool_pop (memcached_pool_st* pool, bool block, memcached_return_t *rc);
23
24         memcached_return_t
25           memcached_pool_push(memcached_pool_st* pool, memcached_st *mmc);
26
27         memcached_st *memcached_create (memcached_st *ptr);
28
29         memcached_return_t
30           memcached_pool_behavior_set(memcached_pool_st *pool,
31                                       memcached_behavior_t flag,
32                                       uint64_t data)
33
34         memcached_return_t
35           memcached_pool_behavior_get(memcached_pool_st *pool,
36                                       memcached_behavior_t flag,
37                                       uint64_t *value)
38

DESCRIPTION

40       memcached_pool_create() is used to create a connection pool of objects
41       you may use to remove the overhead of using memcached_clone for short
42       lived "memcached_st" objects. The mmc argument should be an initialised
43       "memcached_st" structure, and a successfull invocation of
44       memcached_pool_create takes full ownership of the variable (until it is
45       released by memcached_pool_destroy). The "initial" argument specifies
46       the initial size of the connection pool, and the "max" argument
47       specifies the maximum size the connection pool should grow to. Please
48       note that the library will allocate a fixed size buffer scaled to the
49       max size of the connection pool, so you should not pass MAXINT or some
50       other large number here.
51
52       memcached_pool_destroy() is used to destroy the connection pool created
53       with memcached_pool_create() and release all allocated resources. It
54       will return the pointer to the "memcached_st" structure passed as an
55       argument to memcached_pool_create(), and returns the ownership of the
56       pointer to the caller.
57
58       memcached_pool_pop() is used to grab a connection structure from the
59       connection pool. The block argument specifies if the function should
60       block and wait for a connection structure to be available if we try to
61       exceed the maximum size.
62
63       memcached_pool_push() is used to return a connection structure back to
64       the pool.
65
66       memcached_pool_behavior_set() and memcached_pool_behagior_get() is used
67       to get/set behavior flags on all connections in the pool.
68

RETURN

70       memcached_pool_create() returns a pointer to the newly created
71       memcached_pool_st structure. On an allocation failure, it returns NULL.
72
73       memcached_pool_destroy() returns the pointer (and ownership) to the
74       memcached_st structure used to create the pool. If connections are in
75       use it returns NULL.
76
77       memcached_pool_pop() returns a pointer to a memcached_st structure from
78       the pool (or NULL if an allocation cannot be satisfied).
79
80       memcached_pool_push() returns MEMCACHED_SUCCESS upon success.
81
82       memcached_pool_behavior_get() and memcached_pool_behavior_get() returns
83       MEMCACHED_SUCCESS upon success.
84

HOME

86       To find out more information please check:
87       <https://launchpad.net/libmemcached>
88

AUTHOR

90       Trond Norbye, <trond.norbye@gmail.com>
91

SEE ALSO

93       memcached(1) libmemcached(3) memcached_create(3) memcached_free(3)
94       libmemcachedutil(3) memcached_behavior_get(3) memcached_behavior_set(3)
95
96
97
98                                  2010-06-28      memcached_pool_create.pop(3)
Impressum