1..::docs::memcached_pool(3) libmemcachedutil ..::docs::memcached_pool(3)
2
3
4
6 memcached_pool_create, memcached_pool_destroy, memcached_pool_push,
7 memcached_pool_pop - Manage pools
8
10 C Client Library for memcached (libmemcachedutil, -lmemcachedutil)
11
13 #include <libmemcached/memcached_pool.h>
14
15 memcached_pool_st *memcached_pool_create(memcached_st* mmc, int initial, int max);
16 memcached_st* memcached_pool_destroy(memcached_pool_st* pool);
17
18 memcached_st* memcached_pool_pop(memcached_pool_st* pool, bool block, memcached_return *rc);
19 memcached_return memcached_pool_push(memcached_pool_st* pool, memcached_st *mmc);
20
21 memcached_st *memcached_create (memcached_st *ptr);
22
24 memcached_pool_create() is used to create a connection pool of objects
25 you may use to remove the overhead of using memcached_clone for short
26 lived "memcached_st" objects. The mmc argument should be an initialised
27 "memcached_st" structure, and a successfull invocation of
28 memcached_pool_create takes full ownership of the variable (until it is
29 released by memcached_pool_destroy). The "initial" argument specifies
30 the initial size of the connection pool, and the "max" argument
31 specifies the maximum size the connection pool should grow to. Please
32 note that the library will allocate a fixed size buffer scaled to the
33 max size of the connection pool, so you should not pass MAXINT or some
34 other large number here.
35
36 memcached_pool_destroy() is used to destroy the connection pool created
37 with memcached_pool_create() and release all allocated resources. It
38 will return the pointer to the "memcached_st" structure passed as an
39 argument to memcached_pool_create(), and returns the ownership of the
40 pointer to the caller.
41
42 memcached_pool_pop() is used to grab a connection structure from the
43 connection pool. The block argument specifies if the function should
44 block and wait for a connection structure to be available if we try to
45 exceed the maximum size.
46
47 memcached_pool_push() is used to return a connection structure back to
48 the pool.
49
51 memcached_pool_create() returns a pointer to the newly created
52 memcached_pool_st structure. On an allocation failure, it returns NULL.
53
54 memcached_pool_destroy() returns the pointer (and ownership) to the
55 memcached_st structure used to create the pool. If connections are in
56 use it returns NULL.
57
58 memcached_pool_pop() returns a pointer to a memcached_st structure from
59 the pool (or NULL if an allocation cannot be satisfied).
60
61 memcached_pool_push() returns MEMCACHED_SUCCESS upon success.
62
64 To find out more information please check:
65 <http://tangent.org/552/libmemcached.html>
66
68 Trond Norbye, <trond.norbye@sun.com>
69
71 memcached(1) libmemcached(3) memcached_create(3) memcached_free(3)
72 libmemcachedutil(3)
73
74
75
76 2009-05-20 ..::docs::memcached_pool(3)