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