4 memcached_server_count, memcached_server_list, memcached_server_add, memcached_server_push, memcached_server_get_last_disconnect, memcached_server_cursor
5 *********************************************************************************************************************************************************
16 C Client Library for memcached (libmemcached, -lmemcached)
27 #include <memcached.h>
29 uint32_t memcached_server_count (memcached_st *ptr);
32 memcached_server_add (memcached_st *ptr,
37 memcached_server_add_udp (memcached_st *ptr,
42 memcached_server_add_unix_socket (memcached_st *ptr,
46 memcached_server_push (memcached_st *ptr,
47 const memcached_server_st *list);
49 memcached_server_instance_st
50 memcached_server_by_key (const memcached_st *ptr,
53 memcached_return_t *error);
55 memcached_server_instance_st
56 memcached_server_get_last_disconnect (const memcached_st *ptr)
59 memcached_server_cursor(const memcached_st *ptr,
60 const memcached_server_fn *callback,
62 uint32_t number_of_callbacks);
71 libmemcached(3) performs operations on a list of hosts. The order of these
72 hosts determine routing to keys. Functions are provided to add keys to
73 memcached_st structures. To manipulate lists of servers see
74 memcached_server_st(3).
76 memcached_server_count() provides you a count of the current number of
77 servers being used by a \ ``memcached_st``\ structure.
79 memcached_server_add() pushes a single TCP server into the \ ``memcached_st``\
80 structure. This server will be placed at the end. Duplicate servers are
81 allowed, so duplication is not checked. Executing this function with the
82 \ ``MEMCACHED_BEHAVIOR_USE_UDP``\ behavior set will result in a
83 \ ``MEMCACHED_INVALID_HOST_PROTOCOL``\ .
85 memcached_server_add_udp() pushes a single UDP server into the \ ``memcached_st``\
86 structure. This server will be placed at the end. Duplicate servers are
87 allowed, so duplication is not checked. Executing this function with out
88 setting the \ ``MEMCACHED_BEHAVIOR_USE_UDP``\ behavior will result in a
89 \ ``MEMCACHED_INVALID_HOST_PROTOCOL``\ .
91 memcached_server_add_unix_socket() pushes a single UNIX socket into the
92 \ ``memcached_st``\ structure. This UNIX socket will be placed at the end.
93 Duplicate servers are allowed, so duplication is not checked. The length
94 of the filename must be one character less then MEMCACHED_MAX_HOST_LENGTH.
96 memcached_server_push() pushes an array of \ ``memcached_server_st``\ into
97 the \ ``memcached_st``\ structure. These servers will be placed at the
98 end. Duplicate servers are allowed, so duplication is not checked. A
99 copy is made of structure so the list provided (and any operations on
100 the list) are not saved.
102 memcached_server_by_key() allows you to provide a key and retrieve the
103 server which would be used for assignment. This structure is cloned
104 from its original structure and must be freed. If NULL is returned you
105 should consult \*error. The returning structure should be freed with
106 memcached_server_free().
108 memcached_server_get_last_disconnect() returns a pointer to the last server
109 for which there was a connection problem. It does not mean this particular
110 server is currently dead but if the library is reporting a server is,
111 the returned server is a very good candidate.
113 memcached_server_cursor() takes a memcached_st and loops through the
114 list of hosts currently in the cursor calling the list of callback
115 functions provided. You can optionally pass in a value via
116 context which will be provided to each callback function. An error
117 return from any callback will terminate the loop. memcached_server_cursor()
118 is passed the original caller memcached_st in its current state.
126 Varies, see particular functions.
134 To find out more information please check:
135 `https://launchpad.net/libmemcached <https://launchpad.net/libmemcached>`_
143 Brian Aker, <brian@tangent.org>
151 memcached(1) libmemcached(3) memcached_strerror(3)