Deploy to GitHub pages
[awesomized/libmemcached] / libmemcachedutil / memcached_pool.html
1
2
3 <!DOCTYPE html>
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]-->
6 <head>
7 <meta charset="utf-8">
8
9 <meta name="viewport" content="width=device-width, initial-scale=1.0">
10
11 <title>Working with memcached pools &mdash; libmemcached 1.1.0 documentation</title>
12
13
14
15
16
17
18
19
20 <script type="text/javascript" src="../_static/js/modernizr.min.js"></script>
21
22
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>
28
29 <script type="text/javascript" src="../_static/js/theme.js"></script>
30
31
32
33
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" />
41 </head>
42
43 <body class="wy-body-for-nav">
44
45
46 <div class="wy-grid-for-nav">
47
48 <nav data-toggle="wy-nav-shift" class="wy-nav-side">
49 <div class="wy-side-scroll">
50 <div class="wy-side-nav-search" >
51
52
53
54 <a href="../index.html" class="icon icon-home"> libmemcached
55
56
57
58 </a>
59
60
61
62
63 <div class="version">
64 1.1
65 </div>
66
67
68
69
70 <div role="search">
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" />
75 </form>
76 </div>
77
78
79 </div>
80
81 <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
82
83
84
85
86
87
88 <ul class="current">
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>
93 </ul>
94 </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>
98 </ul>
99 <ul>
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>
102 </ul>
103
104
105
106 </div>
107 </div>
108 </nav>
109
110 <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
111
112
113 <nav class="wy-nav-top" aria-label="top navigation">
114
115 <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
116 <a href="../index.html">libmemcached</a>
117
118 </nav>
119
120
121 <div class="wy-nav-content">
122
123 <div class="rst-content">
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141 <div role="navigation" aria-label="breadcrumbs navigation">
142
143 <ul class="wy-breadcrumbs">
144
145 <li><a href="../index.html">Docs</a> &raquo;</li>
146
147 <li><a href="index.html">libmemcachedutil - C/C++ utilities extending libmemcached</a> &raquo;</li>
148
149 <li>Working with memcached pools</li>
150
151
152 <li class="wy-breadcrumbs-aside">
153
154
155
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>
157
158
159
160 </li>
161
162 </ul>
163
164
165 <hr/>
166 </div>
167 <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
168 <div itemprop="articleBody">
169
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 &lt;libmemcachedutil-<a href="#id1"><span class="problematic" id="id2">|libmemcachedutil_version|</span></a>/pool.h&gt;</dt>
176 <dd>Compile and link with -lmemcachedutil -lmemcached</dd>
177 </dl>
178 <dl class="type">
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>
181 <dd></dd></dl>
182
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" />
189 <tbody valign="top">
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>
193 </ul>
194 </td>
195 </tr>
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>
197 </td>
198 </tr>
199 </tbody>
200 </table>
201 </dd></dl>
202
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" />
209 <tbody valign="top">
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>
211 </tr>
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>
213 </tr>
214 </tbody>
215 </table>
216 </dd></dl>
217
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>
223 </div>
224 <table class="docutils field-list" frame="void" rules="none">
225 <col class="field-name" />
226 <col class="field-body" />
227 <tbody valign="top">
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>
232 </ul>
233 </td>
234 </tr>
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>
236 </td>
237 </tr>
238 </tbody>
239 </table>
240 </dd></dl>
241
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>
247 </div>
248 <table class="docutils field-list" frame="void" rules="none">
249 <col class="field-name" />
250 <col class="field-body" />
251 <tbody valign="top">
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>
255 </ul>
256 </td>
257 </tr>
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>
259 </td>
260 </tr>
261 </tbody>
262 </table>
263 </dd></dl>
264
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" />
271 <tbody valign="top">
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>
276 </ul>
277 </td>
278 </tr>
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>
280 </td>
281 </tr>
282 </tbody>
283 </table>
284 </dd></dl>
285
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" />
292 <tbody valign="top">
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>
297 </ul>
298 </td>
299 </tr>
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>
301 </td>
302 </tr>
303 </tbody>
304 </table>
305 </dd></dl>
306
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>
312 </div>
313 </dd></dl>
314
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>
320 </div>
321 </dd></dl>
322
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>
328 </div>
329 </dd></dl>
330
331 </div>
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
348 pool.</p>
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>
352 </div>
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
357 returns NULL.</p>
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
369 be obtained.</p>
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>
372 </div>
373 </div>
374 <div class="section" id="see-also">
375 <h2>SEE ALSO<a class="headerlink" href="#see-also" title="Permalink to this headline"></a></h2>
376 <ul class="simple">
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>
381 </ul>
382 </div>
383 </div>
384
385
386 </div>
387
388 </div>
389 <footer>
390
391 <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
392
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>
394
395
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>
397
398 </div>
399
400
401 <hr/>
402
403 <div role="contentinfo">
404 <p>
405 &copy; <a href="../copyright.html">Copyright</a>
406
407 </p>
408 </div>
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>.
410
411 </footer>
412
413 </div>
414 </div>
415
416 </section>
417
418 </div>
419
420
421
422 <script type="text/javascript">
423 jQuery(function () {
424 SphinxRtdTheme.Navigation.enable(true);
425 });
426 </script>
427
428
429
430
431
432
433 </body>
434 </html>