Merge in all of build.
[awesomized/libmemcached] / docs / man / memcached_pool_create.3
1 .TH "MEMCACHED_POOL_CREATE" "3" "April 09, 2011" "0.47" "libmemcached"
2 .SH NAME
3 memcached_pool_create \- libmemcached Documentation
4 .
5 .nr rst2man-indent-level 0
6 .
7 .de1 rstReportMargin
8 \\$1 \\n[an-margin]
9 level \\n[rst2man-indent-level]
10 level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
11 -
12 \\n[rst2man-indent0]
13 \\n[rst2man-indent1]
14 \\n[rst2man-indent2]
15 ..
16 .de1 INDENT
17 .\" .rstReportMargin pre:
18 . RS \\$1
19 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
20 . nr rst2man-indent-level +1
21 .\" .rstReportMargin post:
22 ..
23 .de UNINDENT
24 . RE
25 .\" indent \\n[an-margin]
26 .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
27 .nr rst2man-indent-level -1
28 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
29 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
30 ..
31 .\" Man page generated from reStructeredText.
32 .
33 .SH SYNOPSIS
34 .sp
35 #include <libmemcached/memcached_pool.h>
36 .INDENT 0.0
37 .TP
38 .B memcached_pool_st * memcached_pool_create(memcached_st* mmc, int initial, int max);
39 .UNINDENT
40 .INDENT 0.0
41 .TP
42 .B memcached_st * memcached_pool_destroy(memcached_pool_st* pool);
43 .UNINDENT
44 .INDENT 0.0
45 .TP
46 .B memcached_st * memcached_pool_pop (memcached_pool_st* pool, bool block, memcached_return_t *rc);
47 .UNINDENT
48 .INDENT 0.0
49 .TP
50 .B memcached_return_t memcached_pool_push(memcached_pool_st* pool, memcached_st *mmc);
51 .UNINDENT
52 .INDENT 0.0
53 .TP
54 .B memcached_st *memcached_create (memcached_st *ptr);
55 .UNINDENT
56 .INDENT 0.0
57 .TP
58 .B memcached_return_t memcached_pool_behavior_set(memcached_pool_st\fI\ *pool\fP, memcached_behavior_t\fI\ flag\fP, uint64_t\fI\ data\fP)
59 .UNINDENT
60 .INDENT 0.0
61 .TP
62 .B memcached_return_t memcached_pool_behavior_get(memcached_pool_st\fI\ *pool\fP, memcached_behavior_t\fI\ flag\fP, uint64_t\fI\ *value\fP)
63 .UNINDENT
64 .sp
65 Compile and link with \-lmemcachedutil \-lmemcached
66 .SH DESCRIPTION
67 .sp
68 memcached_pool_create() is used to create a connection pool of objects you
69 may use to remove the overhead of using memcached_clone for short
70 lived \fBmemcached_st\fP objects. The mmc argument should be an
71 initialised \fBmemcached_st\fP structure, and a successfull invocation of
72 memcached_pool_create takes full ownership of the variable (until it
73 is released by memcached_pool_destroy). The \fBinitial\fP argument
74 specifies the initial size of the connection pool, and the \fBmax\fPargument specifies the maximum size the connection pool should grow
75 to. Please note that the library will allocate a fixed size buffer
76 scaled to the max size of the connection pool, so you should not pass
77 MAXINT or some other large number here.
78 .sp
79 memcached_pool_destroy() is used to destroy the connection pool
80 created with memcached_pool_create() and release all allocated
81 resources. It will return the pointer to the \fBmemcached_st\fP structure
82 passed as an argument to memcached_pool_create(), and returns the
83 ownership of the pointer to the caller.
84 .sp
85 memcached_pool_pop() is used to grab a connection structure from the
86 connection pool. The block argument specifies if the function should
87 block and wait for a connection structure to be available if we try
88 to exceed the maximum size.
89 .sp
90 memcached_pool_push() is used to return a connection structure back to the pool.
91 .sp
92 memcached_pool_behavior_set() and memcached_pool_behagior_get() is
93 used to get/set behavior flags on all connections in the pool.
94 .SH RETURN
95 .sp
96 memcached_pool_create() returns a pointer to the newly created
97 memcached_pool_st structure. On an allocation failure, it returns
98 NULL.
99 .sp
100 memcached_pool_destroy() returns the pointer (and ownership) to the
101 memcached_st structure used to create the pool. If connections are in
102 use it returns NULL.
103 .sp
104 memcached_pool_pop() returns a pointer to a memcached_st structure
105 from the pool (or NULL if an allocation cannot be satisfied).
106 .sp
107 memcached_pool_push() returns MEMCACHED_SUCCESS upon success.
108 .sp
109 memcached_pool_behavior_get() and memcached_pool_behavior_get()
110 returns MEMCACHED_SUCCESS upon success.
111 .SH HOME
112 .sp
113 To find out more information please check:
114 \fI\%https://launchpad.net/libmemcached\fP
115 .SH AUTHOR
116 .sp
117 Brian Aker, <\fI\%brian@tangent.org\fP>
118 .sp
119 Trond Norbye, <\fI\%trond.norbye@gmail.com\fP>
120 .SH SEE ALSO
121 .sp
122 \fImemcached(1)\fP \fIlibmemcached(3)\fP \fImemcached_strerror(3)\fP
123 .SH AUTHOR
124 Brian Aker
125 .SH COPYRIGHT
126 2011, Brian Aker DataDifferential, http://datadifferential.com/
127 .\" Generated by docutils manpage writer.
128 .\"
129 .