1MEMCACHED_POOL_PUSH(3) libmemcached-awesome MEMCACHED_POOL_PUSH(3)
2
3
4
6 memcached_pool_push - libmemcached Documentation
7
9 #include <libmemcachedutil-1.0/pool.h>
10 Compile and link with -lmemcachedutil -lmemcached
11
12 typedef struct memcached_pool_st memcached_pool_st
13
14 memcached_pool_st *memcached_pool(const char *option_string, size_t op‐
15 tion_string_length)
16
17 Parameters
18
19 • option_string -- configuration string
20
21 • option_string_length -- length of options_string with‐
22 out any trailing zero byte
23
24 Returns
25 allocated and initialized memcached_pool_st instance on
26 success or nullptr on failure
27
28 memcached_st *memcached_pool_destroy(memcached_pool_st *pool)
29
30 Parameters
31 pool -- initialized memcached_pool_st instance to free
32
33 Returns
34 pointer to the 'master' memcached_st instance by legacy
35
36 memcached_st *memcached_pool_fetch(memcached_pool_st *pool, struct
37 timespec *relative_time, memcached_return_t *rc)
38 New in version 0.53: Synonym for memcached_pool_pop
39
40
41 Parameters
42
43 • pool -- initialized memcached_pool_st instance
44
45 • relative_time -- time to block thread and wait for a
46 connection to become available when pool size is ex‐
47 ceeded, unless nullptr
48
49 • rc -- out pointer to memcached_return_t
50
51 Returns
52 pointer to an available memcached_st instance
53
54 memcached_return_t memcached_pool_release(memcached_pool_st *pool, mem‐
55 cached_st *mmc)
56 New in version 0.53: Synonym for memcached_pool_push.
57
58
59 Parameters
60
61 • pool -- initialized memcached_pool_st instance
62
63 • mmc -- the memcached_st instance to return to the pool
64
65 Returns
66 memcached_return_t indicating success
67
68 memcached_return_t memcached_pool_behavior_set(memcached_pool_st *pool,
69 memcached_behavior_t flag, uint64_t data)
70
71 Parameters
72
73 • pool -- initialized memcached_pool_st instance
74
75 • flag -- the behavior to change
76
77 • value -- the value to set for flag
78
79 Returns
80 memcached_return_t indicating success
81
82 memcached_return_t memcached_pool_behavior_get(memcached_pool_st *pool,
83 memcached_behavior_t flag, uint64_t *value)
84
85 Parameters
86
87 • pool -- initialized memcached_pool_st instance
88
89 • flag -- the behavior to read
90
91 • value -- out pointer to receive the set value of flag
92
93 Returns
94 memcached_return_t indicating success
95
96 memcached_pool_st *memcached_pool_create(memcached_st *mmc, int ini‐
97 tial, int max)
98 Deprecated since version 0.46: Use memcached_pool()
99
100
101 memcached_st *memcached_pool_pop(memcached_pool_st *pool, bool block,
102 memcached_return_t *rc)
103 Deprecated since version 0.53: Use memcached_pool_fetch()
104
105
106 memcached_return_t memcached_pool_push(memcached_pool_st *pool, mem‐
107 cached_st *mmc)
108 Deprecated since version 0.53: Use memcached_pool_release()
109
110
112 memcached_pool() is used to create a connection pool of objects you may
113 use to remove the overhead of using memcached_clone for short lived
114 memcached_st objects. Please see ../libmemcached/configuration for de‐
115 tails on the format of the configuration string.
116
117 memcached_pool_destroy() is used to destroy the connection pool created
118 with memcached_pool_create() and release all allocated resources. It
119 will return the pointer to the memcached_st structure passed as an ar‐
120 gument to memcached_pool_create(), and returns the ownership of the
121 pointer to the caller when created with memcached_pool_create(), other‐
122 wise NULL is returned..
123
124 memcached_pool_fetch() is used to fetch a connection structure from the
125 connection pool. The relative_time argument specifies if the function
126 should block and wait for a connection structure to be available if we
127 try to exceed the maximum size. You need to specify time in relative
128 time.
129
130 memcached_pool_release() is used to return a connection structure back
131 to the pool.
132
133 memcached_pool_behavior_get() and memcached_pool_behavior_set() is used
134 to get/set behavior flags on all connections in the pool.
135
136 Both memcached_pool_release() and memcached_pool_fetch() are thread
137 safe.
138
140 memcached_pool_destroy() returns the pointer (and ownership) to the
141 memcached_st structure used to create the pool. If connections are in
142 use it returns NULL.
143
144 memcached_pool_pop() returns a pointer to a memcached_st structure from
145 the pool (or NULL if an allocation cannot be satisfied).
146
147 memcached_pool_release() returns MEMCACHED_SUCCESS upon success.
148
149 memcached_pool_behavior_get() and memcached_pool_behavior_get() return
150 MEMCACHED_SUCCESS upon success.
151
152 memcached_pool_fetch() may return MEMCACHED_TIMEOUT if a timeout occurs
153 while waiting for a free memcached_st instance, MEMCACHED_NOTFOUND if
154 no memcached_st instance was available, respectively.
155
156 NOTE:
157 If any method returns MEMCACHED_IN_PROGRESS then a lock on the pool
158 could not be obtained.
159
160 If any of the parameters passed to any of these functions is in‐
161 valid, MEMCACHED_INVALID_ARGUMENTS will be returned.
162
164 memcached(1) libmemcached(3) libmemcached_configuration(3) mem‐
165 cached_strerror(3)
166
167
168
169
1701.1 Feb 02, 2022 MEMCACHED_POOL_PUSH(3)