X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=docs%2Fman%2Fmemcached_pool_create.3;h=93bd087295b096281cf62a4a3486ec8e2bc948e3;hb=9069819ac2940397e96210867e0666b801b97f60;hp=f6611dd83fadcaf354c0fd936a454a91796d97f6;hpb=281c398ba3a10af677494c4453cd09d85ca921e0;p=m6w6%2Flibmemcached diff --git a/docs/man/memcached_pool_create.3 b/docs/man/memcached_pool_create.3 index f6611dd8..d6485cfe 100644 --- a/docs/man/memcached_pool_create.3 +++ b/docs/man/memcached_pool_create.3 @@ -1,4 +1,4 @@ -.TH "MEMCACHED_POOL_CREATE" "3" "April 08, 2011" "0.47" "libmemcached" +.TH "MEMCACHED_POOL_CREATE" "3" "April 17, 2012" "1.0.6" "libmemcached" .SH NAME memcached_pool_create \- libmemcached Documentation . @@ -30,91 +30,111 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .. .\" Man page generated from reStructeredText. . +.SH SYNOPSIS .sp -Manage pools -.SH LIBRARY -.sp -C Client Library for memcached (libmemcachedutil, \-lmemcachedutil) -.SS 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 -.SS 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 +.INDENT 0.0 +.TP +.B memcached_pool_st +.UNINDENT +.INDENT 0.0 +.TP +.B \fI\%memcached_pool_st\fP* memcached_pool(const char\fI\ *option_string\fP, size_t\fI\ option_string_length\fP) +.UNINDENT +.INDENT 0.0 +.TP +.B \fI\%memcached_pool_st\fP* memcached_pool_create(memcached_st*\fI\ mmc\fP, int\fI\ initial\fP, int\fI\ max\fP) +.UNINDENT +.sp +Deprecated since version 0.46: Use \fI\%memcached_pool()\fP +.INDENT 0.0 +.TP +.B memcached_st* memcached_pool_destroy(\fI\%memcached_pool_st\fP*\fI\ pool\fP) +.UNINDENT +.INDENT 0.0 +.TP +.B memcached_st* memcached_pool_pop(\fI\%memcached_pool_st\fP*\fI\ pool\fP, bool\fI\ block\fP, memcached_return_t\fI\ *rc\fP) +.UNINDENT +.sp +Deprecated since version 0.53: Use \fI\%memcached_pool_fetch()\fP +.INDENT 0.0 +.TP +.B memcached_st* memcached_pool_fetch(\fI\%memcached_pool_st\fP*, struct timespec*\fI\ relative_time\fP, memcached_return_t*\fI\ rc\fP) +.UNINDENT +.sp +New in version 0.53: Synonym for memcached_pool_pop +.INDENT 0.0 +.TP +.B memcached_return_t memcached_pool_push(\fI\%memcached_pool_st\fP*\fI\ pool\fP, memcached_st\fI\ *mmc\fP) +.UNINDENT +.sp +Deprecated since version 0.53: Use \fI\%memcached_pool_push()\fP +.INDENT 0.0 +.TP +.B memcached_return_t memcached_pool_release(\fI\%memcached_pool_st\fP*\fI\ pool\fP, memcached_st*\fI\ mmc\fP) +.UNINDENT +.sp +New in version 0.53: Synonym for memcached_pool_push. +.INDENT 0.0 +.TP +.B memcached_return_t memcached_pool_behavior_set(\fI\%memcached_pool_st\fP\fI\ *pool\fP, memcached_behavior_t\fI\ flag\fP, uint64_t\fI\ data\fP) +.UNINDENT +.INDENT 0.0 +.TP +.B memcached_return_t memcached_pool_behavior_get(\fI\%memcached_pool_st\fP\fI\ *pool\fP, memcached_behavior_t\fI\ flag\fP, uint64_t\fI\ *value\fP) +.UNINDENT +.sp +Compile and link with \-lmemcachedutil \-lmemcached +.SH DESCRIPTION +.sp +\fI\%memcached_pool()\fP 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. Please see \fBlibmemcached_configuration\fP for details on the format of the configuration string. +.sp +\fI\%memcached_pool_destroy()\fP is used to destroy the connection pool +created with \fI\%memcached_pool_create()\fP 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. +passed as an argument to \fI\%memcached_pool_create()\fP, and returns the ownership of the pointer to the caller when created with \fI\%memcached_pool_create()\fP, otherwise NULL is returned.. .sp -memcached_pool_pop() is used to grab a connection structure from the -connection pool. The block argument specifies if the function should +\fI\%memcached_pool_fetch()\fP is used to fetch a connection structure from the +connection pool. The relative_time argument specifies if the function should block and wait for a connection structure to be available if we try -to exceed the maximum size. +to exceed the maximum size. You need to specify time in relative time. +.sp +\fI\%memcached_pool_release()\fP is used to return a connection structure back to the pool. .sp -memcached_pool_push() is used to return a connection structure back to the pool. +\fI\%memcached_pool_behavior_get()\fP and \fI\%memcached_pool_behavior_set()\fP is used to get/set behavior flags on all connections in 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. +Both \fI\%memcached_pool_release()\fP and \fI\%memcached_pool_fetch()\fP are thread safe. .SH RETURN .sp -memcached_pool_create() returns a pointer to the newly created -memcached_pool_st structure. On an allocation failure, it returns -NULL. +\fI\%memcached_pool_destroy()\fP returns the pointer (and ownership) to the \fBmemcached_st\fP structure used to create the pool. If connections are in use 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. +\fI\%memcached_pool_pop()\fP returns a pointer to a \fBmemcached_st\fP structure from the pool (or NULL if an allocation cannot be satisfied). .sp -memcached_pool_pop() returns a pointer to a memcached_st structure -from the pool (or NULL if an allocation cannot be satisfied). +\fI\%memcached_pool_release()\fP returns \fBMEMCACHED_SUCCESS\fP upon success. .sp -memcached_pool_push() returns MEMCACHED_SUCCESS upon success. +\fI\%memcached_pool_behavior_get()\fP and \fI\%memcached_pool_behavior_get()\fP returns \fBMEMCACHED_SUCCESS\fP upon success. .sp -memcached_pool_behavior_get() and memcached_pool_behavior_get() -returns MEMCACHED_SUCCESS upon success. +If any methods returns MEMCACHED_IN_PROGRESS then a lock on the pool could not be obtained. If any of the parameters passed to any of these functions is invalid, MEMCACHED_INVALID_ARGUMENTS will be returned. +.sp +memcached_pool_fetch may return MEMCACHED_TIMEOUT if a timeout occurs while waiting for a free memcached_st. MEMCACHED_NOTFOUND if no memcached_st was available. .SH HOME .sp To find out more information please check: -\fI\%https://launchpad.net/libmemcached\fP +\fI\%http://libmemcached.org/\fP .SH AUTHOR .sp +Brian Aker, <\fI\%brian@tangent.org\fP> +.sp Trond Norbye, <\fI\%trond.norbye@gmail.com\fP> -.SS SEE ALSO +.SH SEE ALSO .sp -\fImemcached(1)\fP \fIlibmemcached(3)\fP \fImemcached_strerror(3)\fP +\fImemcached(1)\fP \fIlibmemcached(3)\fP \fImemcached_strerror(3)\fP \fIlibmemcached_configuration(3)\fP .SH AUTHOR Brian Aker .SH COPYRIGHT -2011, Brian Aker +2011, Brian Aker DataDifferential, http://datadifferential.com/ .\" Generated by docutils manpage writer. .\" .