.\" Man page generated from reStructuredText. . . .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 .. .TH "MEMCACHED_POOL_RELEASE" "3" "May 01, 2024" "1.1" "libmemcached-awesome" .SH NAME memcached_pool_release \- libmemcached Documentation .SH SYNOPSIS .INDENT 0.0 .TP .B #include Compile and link with \-lmemcachedutil \-lmemcached .UNINDENT .INDENT 0.0 .TP .B typedef struct \fI\%memcached_pool_st\fP memcached_pool_st .UNINDENT .INDENT 0.0 .TP .B \fI\%memcached_pool_st\fP *memcached_pool(const char *option_string, size_t option_string_length) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBoption_string\fP \-\- \fI\%configuration\fP string .IP \(bu 2 \fBoption_string_length\fP \-\- length of \fBoptions_string\fP without any trailing zero byte .UNINDENT .TP .B Returns allocated and initialized \fI\%memcached_pool_st\fP instance on success or nullptr on failure .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \X'tty: link #_CPPv412memcached_st'\fI\%memcached_st\fP\X'tty: link' *memcached_pool_destroy(\fI\%memcached_pool_st\fP *pool) .INDENT 7.0 .TP .B Parameters \fBpool\fP \-\- initialized \fI\%memcached_pool_st\fP instance to free .TP .B Returns pointer to the \(aqmaster\(aq \X'tty: link #_CPPv412memcached_st'\fI\%memcached_st\fP\X'tty: link' instance by legacy .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \X'tty: link #_CPPv412memcached_st'\fI\%memcached_st\fP\X'tty: link' *memcached_pool_fetch(\fI\%memcached_pool_st\fP *pool, struct timespec *relative_time, \X'tty: link #_CPPv418memcached_return_t'\fI\%memcached_return_t\fP\X'tty: link' *rc) Added in version 0.53: Synonym for memcached_pool_pop .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBpool\fP \-\- initialized \fI\%memcached_pool_st\fP instance .IP \(bu 2 \fBrelative_time\fP \-\- time to block thread and wait for a connection to become available when pool size is exceeded, unless nullptr .IP \(bu 2 \fBrc\fP \-\- out pointer to \X'tty: link #_CPPv418memcached_return_t'\fI\%memcached_return_t\fP\X'tty: link' .UNINDENT .TP .B Returns pointer to an available \X'tty: link #_CPPv412memcached_st'\fI\%memcached_st\fP\X'tty: link' instance .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \X'tty: link #_CPPv418memcached_return_t'\fI\%memcached_return_t\fP\X'tty: link' memcached_pool_release(\fI\%memcached_pool_st\fP *pool, \X'tty: link #_CPPv412memcached_st'\fI\%memcached_st\fP\X'tty: link' *mmc) Added in version 0.53: Synonym for memcached_pool_push. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBpool\fP \-\- initialized \fI\%memcached_pool_st\fP instance .IP \(bu 2 \fBmmc\fP \-\- the \X'tty: link #_CPPv412memcached_st'\fI\%memcached_st\fP\X'tty: link' instance to return to the pool .UNINDENT .TP .B Returns \X'tty: link #_CPPv418memcached_return_t'\fI\%memcached_return_t\fP\X'tty: link' indicating success .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \X'tty: link #_CPPv418memcached_return_t'\fI\%memcached_return_t\fP\X'tty: link' memcached_pool_behavior_set(\fI\%memcached_pool_st\fP *pool, \X'tty: link #_CPPv420memcached_behavior_t'\fI\%memcached_behavior_t\fP\X'tty: link' flag, uint64_t data) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBpool\fP \-\- initialized \fI\%memcached_pool_st\fP instance .IP \(bu 2 \fBflag\fP \-\- the \fI\%behavior\fP to change .IP \(bu 2 \fBvalue\fP \-\- the value to set for \fI\%flag\fP .UNINDENT .TP .B Returns \X'tty: link #_CPPv418memcached_return_t'\fI\%memcached_return_t\fP\X'tty: link' indicating success .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \X'tty: link #_CPPv418memcached_return_t'\fI\%memcached_return_t\fP\X'tty: link' memcached_pool_behavior_get(\fI\%memcached_pool_st\fP *pool, \X'tty: link #_CPPv420memcached_behavior_t'\fI\%memcached_behavior_t\fP\X'tty: link' flag, uint64_t *value) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBpool\fP \-\- initialized \fI\%memcached_pool_st\fP instance .IP \(bu 2 \fBflag\fP \-\- the \fI\%behavior\fP to read .IP \(bu 2 \fBvalue\fP \-\- out pointer to receive the set value of \fI\%flag\fP .UNINDENT .TP .B Returns \X'tty: link #_CPPv418memcached_return_t'\fI\%memcached_return_t\fP\X'tty: link' indicating success .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \fI\%memcached_pool_st\fP *memcached_pool_create(\X'tty: link #_CPPv412memcached_st'\fI\%memcached_st\fP\X'tty: link' *mmc, int initial, int max) Deprecated since version 0.46: Use \fI\%memcached_pool()\fP .UNINDENT .INDENT 0.0 .TP .B \X'tty: link #_CPPv412memcached_st'\fI\%memcached_st\fP\X'tty: link' *memcached_pool_pop(\fI\%memcached_pool_st\fP *pool, bool block, \X'tty: link #_CPPv418memcached_return_t'\fI\%memcached_return_t\fP\X'tty: link' *rc) Deprecated since version 0.53: Use \fI\%memcached_pool_fetch()\fP .UNINDENT .INDENT 0.0 .TP .B \X'tty: link #_CPPv418memcached_return_t'\fI\%memcached_return_t\fP\X'tty: link' memcached_pool_push(\fI\%memcached_pool_st\fP *pool, \X'tty: link #_CPPv412memcached_st'\fI\%memcached_st\fP\X'tty: link' *mmc) Deprecated since version 0.53: Use \fI\%memcached_pool_release()\fP .UNINDENT .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 \X'tty: link #_CPPv412memcached_st'\fI\%memcached_st\fP\X'tty: link' objects. Please see \fI\%libmemcached 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 \X'tty: link #_CPPv412memcached_st'\fI\%memcached_st\fP\X'tty: link' structure 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 \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. 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 \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 Both \fI\%memcached_pool_release()\fP and \fI\%memcached_pool_fetch()\fP are thread safe. .SH RETURN VALUE .sp \fI\%memcached_pool_destroy()\fP returns the pointer (and ownership) to the \X'tty: link #_CPPv412memcached_st'\fI\%memcached_st\fP\X'tty: link' structure used to create the pool. If connections are in use it returns NULL. .sp \fI\%memcached_pool_pop()\fP returns a pointer to a \X'tty: link #_CPPv412memcached_st'\fI\%memcached_st\fP\X'tty: link' structure from the pool (or NULL if an allocation cannot be satisfied). .sp \fI\%memcached_pool_release()\fP returns \X'tty: link #_CPPv4N18memcached_return_t17MEMCACHED_SUCCESSE'\fI\%MEMCACHED_SUCCESS\fP\X'tty: link' upon success. .sp \fI\%memcached_pool_behavior_get()\fP and \fI\%memcached_pool_behavior_get()\fP return \X'tty: link #_CPPv4N18memcached_return_t17MEMCACHED_SUCCESSE'\fI\%MEMCACHED_SUCCESS\fP\X'tty: link' upon success. .sp \fI\%memcached_pool_fetch()\fP may return \X'tty: link #_CPPv4N18memcached_return_t17MEMCACHED_TIMEOUTE'\fI\%MEMCACHED_TIMEOUT\fP\X'tty: link' if a timeout occurs while waiting for a free \X'tty: link #_CPPv412memcached_st'\fI\%memcached_st\fP\X'tty: link' instance, \X'tty: link #_CPPv4N18memcached_return_t18MEMCACHED_NOTFOUNDE'\fI\%MEMCACHED_NOTFOUND\fP\X'tty: link' if no \X'tty: link #_CPPv412memcached_st'\fI\%memcached_st\fP\X'tty: link' instance was available, respectively. .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 If any method returns \fBMEMCACHED_IN_PROGRESS\fP then a lock on the pool could not be obtained. .sp If any of the parameters passed to any of these functions is invalid, \X'tty: link #_CPPv4N18memcached_return_t27MEMCACHED_INVALID_ARGUMENTSE'\fI\%MEMCACHED_INVALID_ARGUMENTS\fP\X'tty: link' will be returned. .UNINDENT .UNINDENT .SH SEE ALSO .sp \fB\X'tty: link https://linux.die.net/man/1/memcached'\fI\%memcached(1)\fP\X'tty: link'\fP \fB\X'tty: link https://linux.die.net/man/3/libmemcached'\fI\%libmemcached(3)\fP\X'tty: link'\fP \fB\X'tty: link https://linux.die.net/man/3/libmemcached_configuration'\fI\%libmemcached_configuration(3)\fP\X'tty: link'\fP \fB\X'tty: link https://linux.die.net/man/3/memcached_strerror'\fI\%memcached_strerror(3)\fP\X'tty: link'\fP .\" Generated by docutils manpage writer. .