1LIBMEMCACHEDUTIL(3)          libmemcached-awesome          LIBMEMCACHEDUTIL(3)
2
3
4

NAME

6       libmemcachedutil - libmemcached Documentation
7
8       Utility library for libmemcached
9

SYNOPSIS

11       #include <libmemcachedutil-1.0/util.h>
12              Compile and link with -lmemcachedutil -lmemcached
13

DESCRIPTION

15       libmemcachedutil  is  a  small and thread-safe client library that pro‐
16       vides extra functionality built on top of libmemcached.
17

THREADS AND PROCESSES

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

SEE ALSO

185       libmemcached(3)    memcached_pool(3)   memcached_pool_destroy(3)   mem‐
186       cached_pool_pop(3) memcached_pool_push(3)
187
188
189
190
1911.1                              Mar 06, 2023              LIBMEMCACHEDUTIL(3)
Impressum