.\" 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_CREATE" "3" "Mar 11, 2024" "1.1" "libmemcached-awesome" .SH NAME memcached_pool_create \- 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 \fI\%memcached_st\fP *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 \fI\%memcached_st\fP instance by legacy .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \fI\%memcached_st\fP *memcached_pool_fetch(\fI\%memcached_pool_st\fP *pool, struct timespec *relative_time, \fI\%memcached_return_t\fP *rc) New 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 \fI\%memcached_return_t\fP .UNINDENT .TP .B Returns pointer to an available \fI\%memcached_st\fP instance .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \fI\%memcached_return_t\fP memcached_pool_release(\fI\%memcached_pool_st\fP *pool, \fI\%memcached_st\fP *mmc) New 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 \fI\%memcached_st\fP instance to return to the pool .UNINDENT .TP .B Returns \fI\%memcached_return_t\fP indicating success .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \fI\%memcached_return_t\fP memcached_pool_behavior_set(\fI\%memcached_pool_st\fP *pool, \fI\%memcached_behavior_t\fP 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 \fI\%memcached_return_t\fP indicating success .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \fI\%memcached_return_t\fP memcached_pool_behavior_get(\fI\%memcached_pool_st\fP *pool, \fI\%memcached_behavior_t\fP 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 \fI\%memcached_return_t\fP indicating success .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \fI\%memcached_pool_st\fP *memcached_pool_create(\fI\%memcached_st\fP *mmc, int initial, int max) Deprecated since version 0.46: Use \fI\%memcached_pool()\fP .UNINDENT .INDENT 0.0 .TP .B \fI\%memcached_st\fP *memcached_pool_pop(\fI\%memcached_pool_st\fP *pool, bool block, \fI\%memcached_return_t\fP *rc) Deprecated since version 0.53: Use \fI\%memcached_pool_fetch()\fP .UNINDENT .INDENT 0.0 .TP .B \fI\%memcached_return_t\fP memcached_pool_push(\fI\%memcached_pool_st\fP *pool, \fI\%memcached_st\fP *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 \fI\%memcached_st\fP 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 \fI\%memcached_st\fP 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 \fI\%memcached_st\fP 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 \fI\%memcached_st\fP structure from the pool (or NULL if an allocation cannot be satisfied). .sp \fI\%memcached_pool_release()\fP returns \fI\%MEMCACHED_SUCCESS\fP upon success. .sp \fI\%memcached_pool_behavior_get()\fP and \fI\%memcached_pool_behavior_get()\fP return \fI\%MEMCACHED_SUCCESS\fP upon success. .sp \fI\%memcached_pool_fetch()\fP may return \fI\%MEMCACHED_TIMEOUT\fP if a timeout occurs while waiting for a free \fI\%memcached_st\fP instance, \fI\%MEMCACHED_NOTFOUND\fP if no \fI\%memcached_st\fP 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, \fI\%MEMCACHED_INVALID_ARGUMENTS\fP will be returned. .UNINDENT .UNINDENT .SH SEE ALSO .sp \fBmemcached(1)\fP \fBlibmemcached(3)\fP \fBlibmemcached_configuration(3)\fP \fBmemcached_strerror(3)\fP .\" Generated by docutils manpage writer. .