1 .TH "MEMCACHED_POOL_CREATE" "3" "April 08, 2011" "0.47" "libmemcached"
3 memcached_pool_create \- libmemcached Documentation
5 .nr rst2man-indent-level 0
9 level \\n[rst2man-indent-level]
10 level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
17 .\" .rstReportMargin pre:
19 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
20 . nr rst2man-indent-level +1
21 .\" .rstReportMargin post:
25 .\" indent \\n[an-margin]
26 .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
27 .nr rst2man-indent-level -1
28 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
29 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
31 .\" Man page generated from reStructeredText.
37 C Client Library for memcached (libmemcachedutil, \-lmemcachedutil)
42 #include <libmemcached/memcached_pool.h>
44 memcached_pool_st * memcached_pool_create(memcached_st* mmc, int initial, int max);
46 memcached_st * memcached_pool_destroy(memcached_pool_st* pool);
48 memcached_st * memcached_pool_pop (memcached_pool_st* pool, bool block, memcached_return_t *rc);
50 memcached_return_t memcached_pool_push(memcached_pool_st* pool, memcached_st *mmc);
52 memcached_st *memcached_create (memcached_st *ptr);
54 memcached_return_t memcached_pool_behavior_set(memcached_pool_st *pool, memcached_behavior_t flag, uint64_t data)
56 memcached_return_t memcached_pool_behavior_get(memcached_pool_st *pool, memcached_behavior_t flag, uint64_t *value)
61 memcached_pool_create() is used to create a connection pool of objects you
62 may use to remove the overhead of using memcached_clone for short
63 lived \fBmemcached_st\fP objects. The mmc argument should be an
64 initialised \fBmemcached_st\fP structure, and a successfull invocation of
65 memcached_pool_create takes full ownership of the variable (until it
66 is released by memcached_pool_destroy). The \fBinitial\fP argument
67 specifies the initial size of the connection pool, and the \fBmax\fPargument specifies the maximum size the connection pool should grow
68 to. Please note that the library will allocate a fixed size buffer
69 scaled to the max size of the connection pool, so you should not pass
70 MAXINT or some other large number here.
72 memcached_pool_destroy() is used to destroy the connection pool
73 created with memcached_pool_create() and release all allocated
74 resources. It will return the pointer to the \fBmemcached_st\fP structure
75 passed as an argument to memcached_pool_create(), and returns the
76 ownership of the pointer to the caller.
78 memcached_pool_pop() is used to grab a connection structure from the
79 connection pool. The block argument specifies if the function should
80 block and wait for a connection structure to be available if we try
81 to exceed the maximum size.
83 memcached_pool_push() is used to return a connection structure back to the pool.
85 memcached_pool_behavior_set() and memcached_pool_behagior_get() is
86 used to get/set behavior flags on all connections in the pool.
89 memcached_pool_create() returns a pointer to the newly created
90 memcached_pool_st structure. On an allocation failure, it returns
93 memcached_pool_destroy() returns the pointer (and ownership) to the
94 memcached_st structure used to create the pool. If connections are in
97 memcached_pool_pop() returns a pointer to a memcached_st structure
98 from the pool (or NULL if an allocation cannot be satisfied).
100 memcached_pool_push() returns MEMCACHED_SUCCESS upon success.
102 memcached_pool_behavior_get() and memcached_pool_behavior_get()
103 returns MEMCACHED_SUCCESS upon success.
106 To find out more information please check:
107 \fI\%https://launchpad.net/libmemcached\fP
110 Trond Norbye, <\fI\%trond.norbye@gmail.com\fP>
113 \fImemcached(1)\fP \fIlibmemcached(3)\fP \fImemcached_strerror(3)\fP
118 .\" Generated by docutils manpage writer.