.TH "MEMCACHED_POOL_CREATE" "3" "April 07, 2011" "0.47" "libmemcached" .SH NAME memcached_pool_create \- libmemcached Documentation . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .\" Man page generated from reStructeredText. . .sp Manage pools .SH LIBRARY .sp C Client Library for memcached (libmemcachedutil, \-lmemcachedutil) .SH SYNOPSIS .sp .nf .ft C #include memcached_pool_st * memcached_pool_create(memcached_st* mmc, int initial, int max); memcached_st * memcached_pool_destroy(memcached_pool_st* pool); memcached_st * memcached_pool_pop (memcached_pool_st* pool, bool block, memcached_return_t *rc); memcached_return_t memcached_pool_push(memcached_pool_st* pool, memcached_st *mmc); memcached_st *memcached_create (memcached_st *ptr); memcached_return_t memcached_pool_behavior_set(memcached_pool_st *pool, memcached_behavior_t flag, uint64_t data) memcached_return_t memcached_pool_behavior_get(memcached_pool_st *pool, memcached_behavior_t flag, uint64_t *value) .ft P .fi .SH DESCRIPTION .sp memcached_pool_create() is used to create a connection pool of objects you may use to remove the overhead of using memcached_clone for short lived \fBmemcached_st\fP objects. The mmc argument should be an initialised \fBmemcached_st\fP structure, and a successfull invocation of memcached_pool_create takes full ownership of the variable (until it is released by memcached_pool_destroy). The \fBinitial\fP argument specifies the initial size of the connection pool, and the \fBmax\fPargument specifies the maximum size the connection pool should grow to. Please note that the library will allocate a fixed size buffer scaled to the max size of the connection pool, so you should not pass MAXINT or some other large number here. .sp memcached_pool_destroy() is used to destroy the connection pool created with memcached_pool_create() and release all allocated resources. It will return the pointer to the \fBmemcached_st\fP structure passed as an argument to memcached_pool_create(), and returns the ownership of the pointer to the caller. .sp memcached_pool_pop() is used to grab a connection structure from the connection pool. The block argument specifies if the function should block and wait for a connection structure to be available if we try to exceed the maximum size. .sp memcached_pool_push() is used to return a connection structure back to the pool. .sp memcached_pool_behavior_set() and memcached_pool_behagior_get() is used to get/set behavior flags on all connections in the pool. .SH RETURN .sp memcached_pool_create() returns a pointer to the newly created memcached_pool_st structure. On an allocation failure, it returns NULL. .sp memcached_pool_destroy() returns the pointer (and ownership) to the memcached_st structure used to create the pool. If connections are in use it returns NULL. .sp memcached_pool_pop() returns a pointer to a memcached_st structure from the pool (or NULL if an allocation cannot be satisfied). .sp memcached_pool_push() returns MEMCACHED_SUCCESS upon success. .sp memcached_pool_behavior_get() and memcached_pool_behavior_get() returns MEMCACHED_SUCCESS upon success. .SH HOME .sp To find out more information please check: \fI\%https://launchpad.net/libmemcached\fP .SH AUTHOR .sp Trond Norbye, <\fI\%trond.norbye@gmail.com\fP> .SH SEE ALSO .sp memcached(1) libmemcached(3) memcached_create(3) memcached_free(3) libmemcachedutil(3) memcached_behavior_get(3) memcached_behavior_set(3) .SH AUTHOR Brian Aker .SH COPYRIGHT 2011, Brian Aker .\" Generated by docutils manpage writer. .\" .