.\" Man page generated from reStructuredText .\" by the Docutils 0.22.3 manpage writer. . . .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_ST" "3" "Mar 07, 2026" "1.1" "libmemcached-awesome" .SH NAME memcached_pool_st \- libmemcached Documentation .SH SYNOPSIS .INDENT 0.0 .TP .B #include Compile and link with \-lmemcachedutil \-lmemcached .UNINDENT .INDENT 0.0 .TP .B typedef struct memcached_pool_st memcached_pool_st .UNINDENT .INDENT 0.0 .TP .B memcached_pool_st *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 \-\- configuration \%<> 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 \fBmemcached_pool_st\fP instance on success or nullptr on failure .UNINDENT .UNINDENT .INDENT 0.0 .TP .B memcached_st \%<#\:_CPPv412memcached_st> *memcached_pool_destroy(memcached_pool_st *pool) .INDENT 7.0 .TP .B Parameters \fBpool\fP \-\- initialized \fBmemcached_pool_st\fP instance to free .TP .B Returns pointer to the \(aqmaster\(aq \fBmemcached_st\fP \%<#\:_CPPv412memcached_st> instance by legacy .UNINDENT .UNINDENT .INDENT 0.0 .TP .B memcached_st \%<#\:_CPPv412memcached_st> *memcached_pool_fetch(memcached_pool_st *pool, struct timespec *relative_time, memcached_return_t \%<#\:_CPPv418memcached_return_t> *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 \fBmemcached_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 \fBmemcached_return_t\fP \%<#\:_CPPv418memcached_return_t> .UNINDENT .TP .B Returns pointer to an available \fBmemcached_st\fP \%<#\:_CPPv412memcached_st> instance .UNINDENT .UNINDENT .INDENT 0.0 .TP .B memcached_return_t \%<#\:_CPPv418memcached_return_t> memcached_pool_release(memcached_pool_st *pool, memcached_st \%<#\:_CPPv412memcached_st> *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 \fBmemcached_pool_st\fP instance .IP \(bu 2 \fBmmc\fP \-\- the \fBmemcached_st\fP \%<#\:_CPPv412memcached_st> instance to return to the pool .UNINDENT .TP .B Returns \fBmemcached_return_t\fP \%<#\:_CPPv418memcached_return_t> indicating success .UNINDENT .UNINDENT .INDENT 0.0 .TP .B memcached_return_t \%<#\:_CPPv418memcached_return_t> memcached_pool_behavior_set(memcached_pool_st *pool, memcached_behavior_t \%<#\:_CPPv420memcached_behavior_t> flag, uint64_t data) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBpool\fP \-\- initialized \fBmemcached_pool_st\fP instance .IP \(bu 2 \fBflag\fP \-\- the behavior \%<> to change .IP \(bu 2 \fBvalue\fP \-\- the value to set for \fBflag\fP .UNINDENT .TP .B Returns \fBmemcached_return_t\fP \%<#\:_CPPv418memcached_return_t> indicating success .UNINDENT .UNINDENT .INDENT 0.0 .TP .B memcached_return_t \%<#\:_CPPv418memcached_return_t> memcached_pool_behavior_get(memcached_pool_st *pool, memcached_behavior_t \%<#\:_CPPv420memcached_behavior_t> flag, uint64_t *value) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBpool\fP \-\- initialized \fBmemcached_pool_st\fP instance .IP \(bu 2 \fBflag\fP \-\- the behavior \%<> to read .IP \(bu 2 \fBvalue\fP \-\- out pointer to receive the set value of \fBflag\fP .UNINDENT .TP .B Returns \fBmemcached_return_t\fP \%<#\:_CPPv418memcached_return_t> indicating success .UNINDENT .UNINDENT .INDENT 0.0 .TP .B memcached_pool_st *memcached_pool_create(memcached_st \%<#\:_CPPv412memcached_st> *mmc, int initial, int max) Deprecated since version 0.46: Use \fBmemcached_pool()\fP .UNINDENT .INDENT 0.0 .TP .B memcached_st \%<#\:_CPPv412memcached_st> *memcached_pool_pop(memcached_pool_st *pool, bool block, memcached_return_t \%<#\:_CPPv418memcached_return_t> *rc) Deprecated since version 0.53: Use \fBmemcached_pool_fetch()\fP .UNINDENT .INDENT 0.0 .TP .B memcached_return_t \%<#\:_CPPv418memcached_return_t> memcached_pool_push(memcached_pool_st *pool, memcached_st \%<#\:_CPPv412memcached_st> *mmc) Deprecated since version 0.53: Use \fBmemcached_pool_release()\fP .UNINDENT .SH DESCRIPTION .sp \fBmemcached_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 \%<#\:_CPPv412memcached_st> objects. Please see libmemcached Configuration \%<> for details on the format of the configuration string. .sp \fBmemcached_pool_destroy()\fP is used to destroy the connection pool created with \fBmemcached_pool_create()\fP and release all allocated resources. It will return the pointer to the \fBmemcached_st\fP \%<#\:_CPPv412memcached_st> structure passed as an argument to \fBmemcached_pool_create()\fP, and returns the ownership of the pointer to the caller when created with \fBmemcached_pool_create()\fP, otherwise NULL is returned.. .sp \fBmemcached_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 \fBmemcached_pool_release()\fP is used to return a connection structure back to the pool. .sp \fBmemcached_pool_behavior_get()\fP and \fBmemcached_pool_behavior_set()\fP is used to get/set behavior flags on all connections in the pool. .sp Both \fBmemcached_pool_release()\fP and \fBmemcached_pool_fetch()\fP are thread safe. .SH RETURN VALUE .sp \fBmemcached_pool_destroy()\fP returns the pointer (and ownership) to the \fBmemcached_st\fP \%<#\:_CPPv412memcached_st> structure used to create the pool. If connections are in use it returns NULL. .sp \fBmemcached_pool_pop()\fP returns a pointer to a \fBmemcached_st\fP \%<#\:_CPPv412memcached_st> structure from the pool (or NULL if an allocation cannot be satisfied). .sp \fBmemcached_pool_release()\fP returns \fBMEMCACHED_SUCCESS\fP \%<#\:_CPPv4N18memcached_return_t17MEMCACHED_SUCCESSE> upon success. .sp \fBmemcached_pool_behavior_get()\fP and \fBmemcached_pool_behavior_get()\fP return \fBMEMCACHED_SUCCESS\fP \%<#\:_CPPv4N18memcached_return_t17MEMCACHED_SUCCESSE> upon success. .sp \fBmemcached_pool_fetch()\fP may return \fBMEMCACHED_TIMEOUT\fP \%<#\:_CPPv4N18memcached_return_t17MEMCACHED_TIMEOUTE> if a timeout occurs while waiting for a free \fBmemcached_st\fP \%<#\:_CPPv412memcached_st> instance, \fBMEMCACHED_NOTFOUND\fP \%<#\:_CPPv4N18memcached_return_t18MEMCACHED_NOTFOUNDE> if no \fBmemcached_st\fP \%<#\:_CPPv412memcached_st> 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, \fBMEMCACHED_INVALID_ARGUMENTS\fP \%<#\:_CPPv4N18memcached_return_t27MEMCACHED_INVALID_ARGUMENTSE> will be returned. .UNINDENT .UNINDENT .SH SEE ALSO .sp \fBmemcached(1) \%\fP \fBlibmemcached(3) \%\fP \fBlibmemcached_configuration(3) \%\fP \fBmemcached_strerror(3) \%\fP .\" End of generated man page.