4 <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
5 <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
9 <meta name=
"viewport" content=
"width=device-width, initial-scale=1.0">
11 <title>Working with memcached pools
— libmemcached
1.1.0 documentation
</title>
20 <script type=
"text/javascript" src=
"../_static/js/modernizr.min.js"></script>
23 <script type=
"text/javascript" id=
"documentation_options" data-url_root=
"../" src=
"../_static/documentation_options.js"></script>
24 <script type=
"text/javascript" src=
"../_static/jquery.js"></script>
25 <script type=
"text/javascript" src=
"../_static/underscore.js"></script>
26 <script type=
"text/javascript" src=
"../_static/doctools.js"></script>
27 <script type=
"text/javascript" src=
"../_static/language_data.js"></script>
29 <script type=
"text/javascript" src=
"../_static/js/theme.js"></script>
34 <link rel=
"stylesheet" href=
"../_static/css/theme.css" type=
"text/css" />
35 <link rel=
"stylesheet" href=
"../_static/pygments.css" type=
"text/css" />
36 <link rel=
"index" title=
"Index" href=
"../genindex.html" />
37 <link rel=
"search" title=
"Search" href=
"../search.html" />
38 <link rel=
"copyright" title=
"Copyright" href=
"../copyright.html" />
39 <link rel=
"next" title=
"libhashkit - C/C++ hashing library" href=
"../libhashkit/index.html" />
40 <link rel=
"prev" title=
"libmemcachedutil - C/C++ utilities extending libmemcached" href=
"index.html" />
43 <body class=
"wy-body-for-nav">
46 <div class=
"wy-grid-for-nav">
48 <nav data-toggle=
"wy-nav-shift" class=
"wy-nav-side">
49 <div class=
"wy-side-scroll">
50 <div class=
"wy-side-nav-search" >
54 <a href=
"../index.html" class=
"icon icon-home"> libmemcached
71 <form id=
"rtd-search-form" class=
"wy-form" action=
"../search.html" method=
"get">
72 <input type=
"text" name=
"q" placeholder=
"Search docs" />
73 <input type=
"hidden" name=
"check_keywords" value=
"yes" />
74 <input type=
"hidden" name=
"area" value=
"default" />
81 <div class=
"wy-menu wy-menu-vertical" data-spy=
"affix" role=
"navigation" aria-label=
"main navigation">
89 <li class=
"toctree-l1"><a class=
"reference internal" href=
"../libmemcached.html">Introduction
</a></li>
90 <li class=
"toctree-l1"><a class=
"reference internal" href=
"../libmemcached/index.html">libmemcached API
</a></li>
91 <li class=
"toctree-l1 current"><a class=
"reference internal" href=
"index.html">libmemcachedutil API
</a><ul class=
"current">
92 <li class=
"toctree-l2 current"><a class=
"current reference internal" href=
"#">Working with memcached pools
</a></li>
95 <li class=
"toctree-l1"><a class=
"reference internal" href=
"../libhashkit/index.html">libhashkit API
</a></li>
96 <li class=
"toctree-l1"><a class=
"reference internal" href=
"../bin/index.html">Client Applications
</a></li>
97 <li class=
"toctree-l1"><a class=
"reference internal" href=
"../libmemcached/index_misc.html">Miscellaneous
</a></li>
100 <li class=
"toctree-l1"><a class=
"reference internal" href=
"../changelogs.html">Change Logs
</a></li>
101 <li class=
"toctree-l1"><a class=
"reference internal" href=
"../copyright.html">Copyright
</a></li>
110 <section data-toggle=
"wy-nav-shift" class=
"wy-nav-content-wrap">
113 <nav class=
"wy-nav-top" aria-label=
"top navigation">
115 <i data-toggle=
"wy-nav-top" class=
"fa fa-bars"></i>
116 <a href=
"../index.html">libmemcached
</a>
121 <div class=
"wy-nav-content">
123 <div class=
"rst-content">
141 <div role=
"navigation" aria-label=
"breadcrumbs navigation">
143 <ul class=
"wy-breadcrumbs">
145 <li><a href=
"../index.html">Docs
</a> »</li>
147 <li><a href=
"index.html">libmemcachedutil - C/C++ utilities extending libmemcached
</a> »</li>
149 <li>Working with memcached pools
</li>
152 <li class=
"wy-breadcrumbs-aside">
156 <a href=
"https://github.com/m6w6/libmemcached/blob/v1.x/docs/source/libmemcachedutil/memcached_pool.rst" class=
"fa fa-github"> Edit on GitHub
</a>
167 <div role=
"main" class=
"document" itemscope=
"itemscope" itemtype=
"http://schema.org/Article">
168 <div itemprop=
"articleBody">
170 <div class=
"section" id=
"working-with-memcached-pools">
171 <h1>Working with memcached pools
<a class=
"headerlink" href=
"#working-with-memcached-pools" title=
"Permalink to this headline">¶
</a></h1>
172 <div class=
"section" id=
"synopsis">
173 <h2>SYNOPSIS
<a class=
"headerlink" href=
"#synopsis" title=
"Permalink to this headline">¶
</a></h2>
174 <dl class=
"docutils">
175 <dt>#include
<libmemcachedutil-
<a href=
"#id1"><span class=
"problematic" id=
"id2">|libmemcachedutil_version|
</span></a>/pool.h
></dt>
176 <dd>Compile and link with -lmemcachedutil -lmemcached
</dd>
179 <dt id=
"_CPPv417memcached_pool_st">
180 <span id=
"_CPPv317memcached_pool_st"></span><span id=
"_CPPv217memcached_pool_st"></span><span id=
"memcached_pool_st"></span><em class=
"property">typedef
</em><em class=
"property">struct
</em> <a class=
"reference internal" href=
"#_CPPv417memcached_pool_st" title=
"memcached_pool_st">memcached_pool_st
</a> <code class=
"descname">memcached_pool_st
</code><a class=
"headerlink" href=
"#_CPPv417memcached_pool_st" title=
"Permalink to this definition">¶
</a><br /></dt>
183 <dl class=
"function">
184 <dt id=
"_CPPv414memcached_poolPKc6size_t">
185 <span id=
"_CPPv314memcached_poolPKc6size_t"></span><span id=
"_CPPv214memcached_poolPKc6size_t"></span><span id=
"memcached_pool__cCP.s"></span><a class=
"reference internal" href=
"#_CPPv417memcached_pool_st" title=
"memcached_pool_st">memcached_pool_st
</a> *
<code class=
"descname">memcached_pool
</code><span class=
"sig-paren">(
</span><em class=
"property">const
</em> char *
<em>option_string
</em>, size_t
<em>option_string_length
</em><span class=
"sig-paren">)
</span><a class=
"headerlink" href=
"#_CPPv414memcached_poolPKc6size_t" title=
"Permalink to this definition">¶
</a><br /></dt>
186 <dd><table class=
"docutils field-list" frame=
"void" rules=
"none">
187 <col class=
"field-name" />
188 <col class=
"field-body" />
190 <tr class=
"field-odd field"><th class=
"field-name">Parameters:
</th><td class=
"field-body"><ul class=
"first simple">
191 <li><strong>option_string
</strong> --
<a class=
"reference internal" href=
"../libmemcached/configuration.html"><span class=
"doc">configuration
</span></a> string
</li>
192 <li><strong>option_string_length
</strong> -- length of
<code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">options_string
</span></code> without any trailing zero byte
</li>
196 <tr class=
"field-even field"><th class=
"field-name">Returns:
</th><td class=
"field-body"><p class=
"first last">allocated and initialized
<a class=
"reference internal" href=
"#_CPPv417memcached_pool_st" title=
"memcached_pool_st"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_pool_st
</span></code></a> instance on success or nullptr on failure
</p>
203 <dl class=
"function">
204 <dt id=
"_CPPv422memcached_pool_destroyP17memcached_pool_st">
205 <span id=
"_CPPv322memcached_pool_destroyP17memcached_pool_st"></span><span id=
"_CPPv222memcached_pool_destroyP17memcached_pool_st"></span><span id=
"memcached_pool_destroy__memcached_pool_stP"></span><a class=
"reference internal" href=
"../libmemcached/memcached_create.html#_CPPv412memcached_st" title=
"memcached_st">memcached_st
</a> *
<code class=
"descname">memcached_pool_destroy
</code><span class=
"sig-paren">(
</span><a class=
"reference internal" href=
"#_CPPv417memcached_pool_st" title=
"memcached_pool_st">memcached_pool_st
</a> *
<em>pool
</em><span class=
"sig-paren">)
</span><a class=
"headerlink" href=
"#_CPPv422memcached_pool_destroyP17memcached_pool_st" title=
"Permalink to this definition">¶
</a><br /></dt>
206 <dd><table class=
"docutils field-list" frame=
"void" rules=
"none">
207 <col class=
"field-name" />
208 <col class=
"field-body" />
210 <tr class=
"field-odd field"><th class=
"field-name">Parameters:
</th><td class=
"field-body"><strong>pool
</strong> -- initialized
<a class=
"reference internal" href=
"#_CPPv417memcached_pool_st" title=
"memcached_pool_st"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_pool_st
</span></code></a> instance to free
</td>
212 <tr class=
"field-even field"><th class=
"field-name">Returns:
</th><td class=
"field-body">pointer to the 'master'
<a class=
"reference internal" href=
"../libmemcached/memcached_create.html#_CPPv412memcached_st" title=
"memcached_st"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_st
</span></code></a> instance by legacy
</td>
218 <dl class=
"function">
219 <dt id=
"_CPPv420memcached_pool_fetchP17memcached_pool_stP8timespecP18memcached_return_t">
220 <span id=
"_CPPv320memcached_pool_fetchP17memcached_pool_stP8timespecP18memcached_return_t"></span><span id=
"_CPPv220memcached_pool_fetchP17memcached_pool_stP8timespecP18memcached_return_t"></span><span id=
"memcached_pool_fetch__memcached_pool_stP.timespecP.memcached_return_tP"></span><a class=
"reference internal" href=
"../libmemcached/memcached_create.html#_CPPv412memcached_st" title=
"memcached_st">memcached_st
</a> *
<code class=
"descname">memcached_pool_fetch
</code><span class=
"sig-paren">(
</span><a class=
"reference internal" href=
"#_CPPv417memcached_pool_st" title=
"memcached_pool_st">memcached_pool_st
</a> *
<em>pool
</em>,
<em class=
"property">struct
</em> timespec *
<em>relative_time
</em>,
<a class=
"reference internal" href=
"../libmemcached/memcached_return_t.html#_CPPv418memcached_return_t" title=
"memcached_return_t">memcached_return_t
</a> *
<em>rc
</em><span class=
"sig-paren">)
</span><a class=
"headerlink" href=
"#_CPPv420memcached_pool_fetchP17memcached_pool_stP8timespecP18memcached_return_t" title=
"Permalink to this definition">¶
</a><br /></dt>
221 <dd><div class=
"versionadded">
222 <p><span class=
"versionmodified">New in version
0.53:
</span>Synonym for memcached_pool_pop
</p>
224 <table class=
"docutils field-list" frame=
"void" rules=
"none">
225 <col class=
"field-name" />
226 <col class=
"field-body" />
228 <tr class=
"field-odd field"><th class=
"field-name">Parameters:
</th><td class=
"field-body"><ul class=
"first simple">
229 <li><strong>pool
</strong> -- initialized
<a class=
"reference internal" href=
"#_CPPv417memcached_pool_st" title=
"memcached_pool_st"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_pool_st
</span></code></a> instance
</li>
230 <li><strong>relative_time
</strong> -- time to block thread and wait for a connection to become available when pool size is exceeded, unless nullptr
</li>
231 <li><strong>rc
</strong> -- out pointer to
<a class=
"reference internal" href=
"../libmemcached/memcached_return_t.html#_CPPv418memcached_return_t" title=
"memcached_return_t"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_return_t
</span></code></a></li>
235 <tr class=
"field-even field"><th class=
"field-name">Returns:
</th><td class=
"field-body"><p class=
"first last">pointer to an available
<a class=
"reference internal" href=
"../libmemcached/memcached_create.html#_CPPv412memcached_st" title=
"memcached_st"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_st
</span></code></a> instance
</p>
242 <dl class=
"function">
243 <dt id=
"_CPPv422memcached_pool_releaseP17memcached_pool_stP12memcached_st">
244 <span id=
"_CPPv322memcached_pool_releaseP17memcached_pool_stP12memcached_st"></span><span id=
"_CPPv222memcached_pool_releaseP17memcached_pool_stP12memcached_st"></span><span id=
"memcached_pool_release__memcached_pool_stP.memcached_stP"></span><a class=
"reference internal" href=
"../libmemcached/memcached_return_t.html#_CPPv418memcached_return_t" title=
"memcached_return_t">memcached_return_t
</a> <code class=
"descname">memcached_pool_release
</code><span class=
"sig-paren">(
</span><a class=
"reference internal" href=
"#_CPPv417memcached_pool_st" title=
"memcached_pool_st">memcached_pool_st
</a> *
<em>pool
</em>,
<a class=
"reference internal" href=
"../libmemcached/memcached_create.html#_CPPv412memcached_st" title=
"memcached_st">memcached_st
</a> *
<em>mmc
</em><span class=
"sig-paren">)
</span><a class=
"headerlink" href=
"#_CPPv422memcached_pool_releaseP17memcached_pool_stP12memcached_st" title=
"Permalink to this definition">¶
</a><br /></dt>
245 <dd><div class=
"versionadded">
246 <p><span class=
"versionmodified">New in version
0.53:
</span>Synonym for memcached_pool_push.
</p>
248 <table class=
"docutils field-list" frame=
"void" rules=
"none">
249 <col class=
"field-name" />
250 <col class=
"field-body" />
252 <tr class=
"field-odd field"><th class=
"field-name">Parameters:
</th><td class=
"field-body"><ul class=
"first simple">
253 <li><strong>pool
</strong> -- initialized
<a class=
"reference internal" href=
"#_CPPv417memcached_pool_st" title=
"memcached_pool_st"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_pool_st
</span></code></a> instance
</li>
254 <li><strong>mmc
</strong> -- the
<a class=
"reference internal" href=
"../libmemcached/memcached_create.html#_CPPv412memcached_st" title=
"memcached_st"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_st
</span></code></a> instance to return to the pool
</li>
258 <tr class=
"field-even field"><th class=
"field-name">Returns:
</th><td class=
"field-body"><p class=
"first last"><a class=
"reference internal" href=
"../libmemcached/memcached_return_t.html#_CPPv418memcached_return_t" title=
"memcached_return_t"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_return_t
</span></code></a> indicating success
</p>
265 <dl class=
"function">
266 <dt id=
"_CPPv427memcached_pool_behavior_setP17memcached_pool_st20memcached_behavior_t8uint64_t">
267 <span id=
"_CPPv327memcached_pool_behavior_setP17memcached_pool_st20memcached_behavior_t8uint64_t"></span><span id=
"_CPPv227memcached_pool_behavior_setP17memcached_pool_st20memcached_behavior_t8uint64_t"></span><span id=
"memcached_pool_behavior_set__memcached_pool_stP.memcached_behavior_t.uint64_t"></span><a class=
"reference internal" href=
"../libmemcached/memcached_return_t.html#_CPPv418memcached_return_t" title=
"memcached_return_t">memcached_return_t
</a> <code class=
"descname">memcached_pool_behavior_set
</code><span class=
"sig-paren">(
</span><a class=
"reference internal" href=
"#_CPPv417memcached_pool_st" title=
"memcached_pool_st">memcached_pool_st
</a> *
<em>pool
</em>,
<a class=
"reference internal" href=
"../libmemcached/memcached_behavior.html#_CPPv420memcached_behavior_t" title=
"memcached_behavior_t">memcached_behavior_t
</a> <em>flag
</em>, uint64_t
<em>data
</em><span class=
"sig-paren">)
</span><a class=
"headerlink" href=
"#_CPPv427memcached_pool_behavior_setP17memcached_pool_st20memcached_behavior_t8uint64_t" title=
"Permalink to this definition">¶
</a><br /></dt>
268 <dd><table class=
"docutils field-list" frame=
"void" rules=
"none">
269 <col class=
"field-name" />
270 <col class=
"field-body" />
272 <tr class=
"field-odd field"><th class=
"field-name">Parameters:
</th><td class=
"field-body"><ul class=
"first simple">
273 <li><strong>pool
</strong> -- initialized
<a class=
"reference internal" href=
"#_CPPv417memcached_pool_st" title=
"memcached_pool_st"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_pool_st
</span></code></a> instance
</li>
274 <li><strong>flag
</strong> -- the
<a class=
"reference internal" href=
"../libmemcached/memcached_behavior.html"><span class=
"doc">behavior
</span></a> to change
</li>
275 <li><strong>value
</strong> -- the value to set for
<a class=
"reference internal" href=
"#_CPPv427memcached_pool_behavior_setP17memcached_pool_st20memcached_behavior_t8uint64_t" title=
"memcached_pool_behavior_set::flag"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">flag
</span></code></a></li>
279 <tr class=
"field-even field"><th class=
"field-name">Returns:
</th><td class=
"field-body"><p class=
"first last"><a class=
"reference internal" href=
"../libmemcached/memcached_return_t.html#_CPPv418memcached_return_t" title=
"memcached_return_t"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_return_t
</span></code></a> indicating success
</p>
286 <dl class=
"function">
287 <dt id=
"_CPPv427memcached_pool_behavior_getP17memcached_pool_st20memcached_behavior_tP8uint64_t">
288 <span id=
"_CPPv327memcached_pool_behavior_getP17memcached_pool_st20memcached_behavior_tP8uint64_t"></span><span id=
"_CPPv227memcached_pool_behavior_getP17memcached_pool_st20memcached_behavior_tP8uint64_t"></span><span id=
"memcached_pool_behavior_get__memcached_pool_stP.memcached_behavior_t.uint64_tP"></span><a class=
"reference internal" href=
"../libmemcached/memcached_return_t.html#_CPPv418memcached_return_t" title=
"memcached_return_t">memcached_return_t
</a> <code class=
"descname">memcached_pool_behavior_get
</code><span class=
"sig-paren">(
</span><a class=
"reference internal" href=
"#_CPPv417memcached_pool_st" title=
"memcached_pool_st">memcached_pool_st
</a> *
<em>pool
</em>,
<a class=
"reference internal" href=
"../libmemcached/memcached_behavior.html#_CPPv420memcached_behavior_t" title=
"memcached_behavior_t">memcached_behavior_t
</a> <em>flag
</em>, uint64_t *
<em>value
</em><span class=
"sig-paren">)
</span><a class=
"headerlink" href=
"#_CPPv427memcached_pool_behavior_getP17memcached_pool_st20memcached_behavior_tP8uint64_t" title=
"Permalink to this definition">¶
</a><br /></dt>
289 <dd><table class=
"docutils field-list" frame=
"void" rules=
"none">
290 <col class=
"field-name" />
291 <col class=
"field-body" />
293 <tr class=
"field-odd field"><th class=
"field-name">Parameters:
</th><td class=
"field-body"><ul class=
"first simple">
294 <li><strong>pool
</strong> -- initialized
<a class=
"reference internal" href=
"#_CPPv417memcached_pool_st" title=
"memcached_pool_st"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_pool_st
</span></code></a> instance
</li>
295 <li><strong>flag
</strong> -- the
<a class=
"reference internal" href=
"../libmemcached/memcached_behavior.html"><span class=
"doc">behavior
</span></a> to read
</li>
296 <li><strong>value
</strong> -- out pointer to receive the set value of
<a class=
"reference internal" href=
"#_CPPv427memcached_pool_behavior_getP17memcached_pool_st20memcached_behavior_tP8uint64_t" title=
"memcached_pool_behavior_get::flag"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">flag
</span></code></a></li>
300 <tr class=
"field-even field"><th class=
"field-name">Returns:
</th><td class=
"field-body"><p class=
"first last"><a class=
"reference internal" href=
"../libmemcached/memcached_return_t.html#_CPPv418memcached_return_t" title=
"memcached_return_t"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_return_t
</span></code></a> indicating success
</p>
307 <dl class=
"function">
308 <dt id=
"_CPPv421memcached_pool_createP12memcached_stii">
309 <span id=
"_CPPv321memcached_pool_createP12memcached_stii"></span><span id=
"_CPPv221memcached_pool_createP12memcached_stii"></span><span id=
"memcached_pool_create__memcached_stP.i.i"></span><a class=
"reference internal" href=
"#_CPPv417memcached_pool_st" title=
"memcached_pool_st">memcached_pool_st
</a> *
<code class=
"descname">memcached_pool_create
</code><span class=
"sig-paren">(
</span><a class=
"reference internal" href=
"../libmemcached/memcached_create.html#_CPPv412memcached_st" title=
"memcached_st">memcached_st
</a> *
<em>mmc
</em>, int
<em>initial
</em>, int
<em>max
</em><span class=
"sig-paren">)
</span><a class=
"headerlink" href=
"#_CPPv421memcached_pool_createP12memcached_stii" title=
"Permalink to this definition">¶
</a><br /></dt>
310 <dd><div class=
"deprecated">
311 <p><span class=
"versionmodified">Deprecated since version
0.46:
</span>Use
<a class=
"reference internal" href=
"#_CPPv414memcached_poolPKc6size_t" title=
"memcached_pool"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_pool()
</span></code></a></p>
315 <dl class=
"function">
316 <dt id=
"_CPPv418memcached_pool_popP17memcached_pool_stbP18memcached_return_t">
317 <span id=
"_CPPv318memcached_pool_popP17memcached_pool_stbP18memcached_return_t"></span><span id=
"_CPPv218memcached_pool_popP17memcached_pool_stbP18memcached_return_t"></span><span id=
"memcached_pool_pop__memcached_pool_stP.b.memcached_return_tP"></span><a class=
"reference internal" href=
"../libmemcached/memcached_create.html#_CPPv412memcached_st" title=
"memcached_st">memcached_st
</a> *
<code class=
"descname">memcached_pool_pop
</code><span class=
"sig-paren">(
</span><a class=
"reference internal" href=
"#_CPPv417memcached_pool_st" title=
"memcached_pool_st">memcached_pool_st
</a> *
<em>pool
</em>, bool
<em>block
</em>,
<a class=
"reference internal" href=
"../libmemcached/memcached_return_t.html#_CPPv418memcached_return_t" title=
"memcached_return_t">memcached_return_t
</a> *
<em>rc
</em><span class=
"sig-paren">)
</span><a class=
"headerlink" href=
"#_CPPv418memcached_pool_popP17memcached_pool_stbP18memcached_return_t" title=
"Permalink to this definition">¶
</a><br /></dt>
318 <dd><div class=
"deprecated">
319 <p><span class=
"versionmodified">Deprecated since version
0.53:
</span>Use
<a class=
"reference internal" href=
"#_CPPv420memcached_pool_fetchP17memcached_pool_stP8timespecP18memcached_return_t" title=
"memcached_pool_fetch"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_pool_fetch()
</span></code></a></p>
323 <dl class=
"function">
324 <dt id=
"_CPPv419memcached_pool_pushP17memcached_pool_stP12memcached_st">
325 <span id=
"_CPPv319memcached_pool_pushP17memcached_pool_stP12memcached_st"></span><span id=
"_CPPv219memcached_pool_pushP17memcached_pool_stP12memcached_st"></span><span id=
"memcached_pool_push__memcached_pool_stP.memcached_stP"></span><a class=
"reference internal" href=
"../libmemcached/memcached_return_t.html#_CPPv418memcached_return_t" title=
"memcached_return_t">memcached_return_t
</a> <code class=
"descname">memcached_pool_push
</code><span class=
"sig-paren">(
</span><a class=
"reference internal" href=
"#_CPPv417memcached_pool_st" title=
"memcached_pool_st">memcached_pool_st
</a> *
<em>pool
</em>,
<a class=
"reference internal" href=
"../libmemcached/memcached_create.html#_CPPv412memcached_st" title=
"memcached_st">memcached_st
</a> *
<em>mmc
</em><span class=
"sig-paren">)
</span><a class=
"headerlink" href=
"#_CPPv419memcached_pool_pushP17memcached_pool_stP12memcached_st" title=
"Permalink to this definition">¶
</a><br /></dt>
326 <dd><div class=
"deprecated">
327 <p><span class=
"versionmodified">Deprecated since version
0.53:
</span>Use
<a class=
"reference internal" href=
"#_CPPv422memcached_pool_releaseP17memcached_pool_stP12memcached_st" title=
"memcached_pool_release"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_pool_release()
</span></code></a></p>
332 <div class=
"section" id=
"description">
333 <h2>DESCRIPTION
<a class=
"headerlink" href=
"#description" title=
"Permalink to this headline">¶
</a></h2>
334 <p><a class=
"reference internal" href=
"#_CPPv414memcached_poolPKc6size_t" title=
"memcached_pool"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_pool()
</span></code></a> is used to create a connection pool of objects you may use to
335 remove the overhead of using memcached_clone for short lived
<a class=
"reference internal" href=
"../libmemcached/memcached_create.html#_CPPv412memcached_st" title=
"memcached_st"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_st
</span></code></a>
336 objects. Please see
<a class=
"reference internal" href=
"../libmemcached/configuration.html"><span class=
"doc">libmemcached Configuration
</span></a> for details on the
337 format of the configuration string.
</p>
338 <p><a class=
"reference internal" href=
"#_CPPv422memcached_pool_destroyP17memcached_pool_st" title=
"memcached_pool_destroy"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_pool_destroy()
</span></code></a> is used to destroy the connection pool created with
339 <a class=
"reference internal" href=
"#_CPPv421memcached_pool_createP12memcached_stii" title=
"memcached_pool_create"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_pool_create()
</span></code></a> and release all allocated resources. It will return the
340 pointer to the
<a class=
"reference internal" href=
"../libmemcached/memcached_create.html#_CPPv412memcached_st" title=
"memcached_st"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_st
</span></code></a> structure passed as an argument to
341 <a class=
"reference internal" href=
"#_CPPv421memcached_pool_createP12memcached_stii" title=
"memcached_pool_create"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_pool_create()
</span></code></a>, and returns the ownership of the pointer to the caller
342 when created with
<a class=
"reference internal" href=
"#_CPPv421memcached_pool_createP12memcached_stii" title=
"memcached_pool_create"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_pool_create()
</span></code></a>, otherwise NULL is returned..
</p>
343 <p><a class=
"reference internal" href=
"#_CPPv420memcached_pool_fetchP17memcached_pool_stP8timespecP18memcached_return_t" title=
"memcached_pool_fetch"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_pool_fetch()
</span></code></a> is used to fetch a connection structure from the
344 connection pool. The relative_time argument specifies if the function should
345 block and wait for a connection structure to be available if we try to exceed
346 the maximum size. You need to specify time in relative time.
</p>
347 <p><a class=
"reference internal" href=
"#_CPPv422memcached_pool_releaseP17memcached_pool_stP12memcached_st" title=
"memcached_pool_release"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_pool_release()
</span></code></a> is used to return a connection structure back to the
349 <p><a class=
"reference internal" href=
"#_CPPv427memcached_pool_behavior_getP17memcached_pool_st20memcached_behavior_tP8uint64_t" title=
"memcached_pool_behavior_get"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_pool_behavior_get()
</span></code></a> and
<a class=
"reference internal" href=
"#_CPPv427memcached_pool_behavior_setP17memcached_pool_st20memcached_behavior_t8uint64_t" title=
"memcached_pool_behavior_set"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_pool_behavior_set()
</span></code></a> is used to
350 get/set behavior flags on all connections in the pool.
</p>
351 <p>Both
<a class=
"reference internal" href=
"#_CPPv422memcached_pool_releaseP17memcached_pool_stP12memcached_st" title=
"memcached_pool_release"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_pool_release()
</span></code></a> and
<a class=
"reference internal" href=
"#_CPPv420memcached_pool_fetchP17memcached_pool_stP8timespecP18memcached_return_t" title=
"memcached_pool_fetch"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_pool_fetch()
</span></code></a> are thread safe.
</p>
353 <div class=
"section" id=
"return-value">
354 <h2>RETURN VALUE
<a class=
"headerlink" href=
"#return-value" title=
"Permalink to this headline">¶
</a></h2>
355 <p><a class=
"reference internal" href=
"#_CPPv422memcached_pool_destroyP17memcached_pool_st" title=
"memcached_pool_destroy"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_pool_destroy()
</span></code></a> returns the pointer (and ownership) to the
356 <a class=
"reference internal" href=
"../libmemcached/memcached_create.html#_CPPv412memcached_st" title=
"memcached_st"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_st
</span></code></a> structure used to create the pool. If connections are in use it
358 <p><a class=
"reference internal" href=
"#_CPPv418memcached_pool_popP17memcached_pool_stbP18memcached_return_t" title=
"memcached_pool_pop"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_pool_pop()
</span></code></a> returns a pointer to a
<a class=
"reference internal" href=
"../libmemcached/memcached_create.html#_CPPv412memcached_st" title=
"memcached_st"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_st
</span></code></a> structure from the
359 pool (or NULL if an allocation cannot be satisfied).
</p>
360 <p><a class=
"reference internal" href=
"#_CPPv422memcached_pool_releaseP17memcached_pool_stP12memcached_st" title=
"memcached_pool_release"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_pool_release()
</span></code></a> returns
<a class=
"reference internal" href=
"../libmemcached/memcached_return_t.html#_CPPv4N18memcached_return_t17MEMCACHED_SUCCESSE" title=
"MEMCACHED_SUCCESS"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_SUCCESS
</span></code></a> upon success.
</p>
361 <p><a class=
"reference internal" href=
"#_CPPv427memcached_pool_behavior_getP17memcached_pool_st20memcached_behavior_tP8uint64_t" title=
"memcached_pool_behavior_get"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_pool_behavior_get()
</span></code></a> and
<a class=
"reference internal" href=
"#_CPPv427memcached_pool_behavior_getP17memcached_pool_st20memcached_behavior_tP8uint64_t" title=
"memcached_pool_behavior_get"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_pool_behavior_get()
</span></code></a> return
362 <a class=
"reference internal" href=
"../libmemcached/memcached_return_t.html#_CPPv4N18memcached_return_t17MEMCACHED_SUCCESSE" title=
"MEMCACHED_SUCCESS"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_SUCCESS
</span></code></a> upon success.
</p>
363 <p><a class=
"reference internal" href=
"#_CPPv420memcached_pool_fetchP17memcached_pool_stP8timespecP18memcached_return_t" title=
"memcached_pool_fetch"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_pool_fetch()
</span></code></a> may return
<a class=
"reference internal" href=
"../libmemcached/memcached_return_t.html#_CPPv4N18memcached_return_t17MEMCACHED_TIMEOUTE" title=
"MEMCACHED_TIMEOUT"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_TIMEOUT
</span></code></a> if a timeout occurs while
364 waiting for a free
<a class=
"reference internal" href=
"../libmemcached/memcached_create.html#_CPPv412memcached_st" title=
"memcached_st"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_st
</span></code></a> instance,
<a class=
"reference internal" href=
"../libmemcached/memcached_return_t.html#_CPPv4N18memcached_return_t18MEMCACHED_NOTFOUNDE" title=
"MEMCACHED_NOTFOUND"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_NOTFOUND
</span></code></a> if no
<a class=
"reference internal" href=
"../libmemcached/memcached_create.html#_CPPv412memcached_st" title=
"memcached_st"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">memcached_st
</span></code></a>
365 instance was available, respectively.
</p>
366 <div class=
"admonition note">
367 <p class=
"first admonition-title">Note
</p>
368 <p>If any method returns
<code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_IN_PROGRESS
</span></code> then a lock on the pool could not
370 <p class=
"last">If any of the parameters passed to any of these functions is
371 invalid,
<a class=
"reference internal" href=
"../libmemcached/memcached_return_t.html#_CPPv4N18memcached_return_t27MEMCACHED_INVALID_ARGUMENTSE" title=
"MEMCACHED_INVALID_ARGUMENTS"><code class=
"xref cpp cpp-any docutils literal notranslate"><span class=
"pre">MEMCACHED_INVALID_ARGUMENTS
</span></code></a> will be returned.
</p>
374 <div class=
"section" id=
"see-also">
375 <h2>SEE ALSO
<a class=
"headerlink" href=
"#see-also" title=
"Permalink to this headline">¶
</a></h2>
377 <li><em class=
"manpage"><a class=
"manpage reference external" href=
"https://linux.die.net/man/1/memcached">memcached(
1)
</a></em></li>
378 <li><a class=
"reference internal" href=
"../libmemcached.html"><span class=
"doc">C/C++ Client Library for memcached
</span></a></li>
379 <li><a class=
"reference internal" href=
"../libmemcached/configuration.html"><span class=
"doc">libmemcached Configuration
</span></a></li>
380 <li><a class=
"reference internal" href=
"../libmemcached/memcached_strerror.html"><span class=
"doc">Converting Error Codes to Messages
</span></a></li>
391 <div class=
"rst-footer-buttons" role=
"navigation" aria-label=
"footer navigation">
393 <a href=
"../libhashkit/index.html" class=
"btn btn-neutral float-right" title=
"libhashkit - C/C++ hashing library" accesskey=
"n" rel=
"next">Next
<span class=
"fa fa-arrow-circle-right"></span></a>
396 <a href=
"index.html" class=
"btn btn-neutral float-left" title=
"libmemcachedutil - C/C++ utilities extending libmemcached" accesskey=
"p" rel=
"prev"><span class=
"fa fa-arrow-circle-left"></span> Previous
</a>
403 <div role=
"contentinfo">
405 © <a href=
"../copyright.html">Copyright
</a>
409 Built with
<a href=
"http://sphinx-doc.org/">Sphinx
</a> using a
<a href=
"https://github.com/rtfd/sphinx_rtd_theme">theme
</a> provided by
<a href=
"https://readthedocs.org">Read the Docs
</a>.
422 <script type=
"text/javascript">
424 SphinxRtdTheme.Navigation.enable(true);