Rollup merge.
[awesomized/libmemcached] / docs / memcached_servers.pod
1 =head1 NAME
2
3 memcached_server_count, memcached_server_list, memcached_server_add, memcached_server_push, memcached_server_get_last_disconnect, memcached_server_cursor - Manage server list
4
5 =head1 LIBRARY
6
7 C Client Library for memcached (libmemcached, -lmemcached)
8
9 =head1 SYNOPSIS
10
11 #include <memcached.h>
12
13 uint32_t memcached_server_count (memcached_st *ptr);
14
15 memcached_return_t
16 memcached_server_add (memcached_st *ptr,
17 const char *hostname,
18 in_port_t port);
19
20 memcached_return_t
21 memcached_server_add_udp (memcached_st *ptr,
22 const char *hostname,
23 in_port_t port);
24
25 memcached_return_t
26 memcached_server_add_unix_socket (memcached_st *ptr,
27 const char *socket);
28
29 memcached_return_t
30 memcached_server_push (memcached_st *ptr,
31 const memcached_server_st *list);
32
33 memcached_server_instance_st
34 memcached_server_by_key (const memcached_st *ptr,
35 const char *key,
36 size_t key_length,
37 memcached_return_t *error);
38
39 memcached_server_instance_st
40 memcached_server_get_last_disconnect (const memcached_st *ptr)
41
42 memcached_return_t
43 memcached_server_cursor(const memcached_st *ptr,
44 const memcached_server_fn *callback,
45 void *context,
46 uint32_t number_of_callbacks);
47
48
49 =head1 DESCRIPTION
50
51 libmemcached(3) performs operations on a list of hosts. The order of these
52 hosts determine routing to keys. Functions are provided to add keys to
53 memcached_st structures. To manipulate lists of servers see
54 memcached_server_st(3).
55
56 memcached_server_count() provides you a count of the current number of
57 servers being used by a C<memcached_st> structure.
58
59 memcached_server_add() pushes a single TCP server into the C<memcached_st>
60 structure. This server will be placed at the end. Duplicate servers are
61 allowed, so duplication is not checked. Executing this function with the
62 C<MEMCACHED_BEHAVIOR_USE_UDP> behavior set will result in a
63 C<MEMCACHED_INVALID_HOST_PROTOCOL>.
64
65 memcached_server_add_udp() pushes a single UDP server into the C<memcached_st>
66 structure. This server will be placed at the end. Duplicate servers are
67 allowed, so duplication is not checked. Executing this function with out
68 setting the C<MEMCACHED_BEHAVIOR_USE_UDP> behavior will result in a
69 C<MEMCACHED_INVALID_HOST_PROTOCOL>.
70
71 memcached_server_add_unix_socket() pushes a single UNIX socket into the
72 C<memcached_st> structure. This UNIX socket will be placed at the end.
73 Duplicate servers are allowed, so duplication is not checked. The length
74 of the filename must be one character less then MEMCACHED_MAX_HOST_LENGTH.
75
76 memcached_server_push() pushes an array of C<memcached_server_st> into
77 the C<memcached_st> structure. These servers will be placed at the
78 end. Duplicate servers are allowed, so duplication is not checked. A
79 copy is made of structure so the list provided (and any operations on
80 the list) are not saved.
81
82 memcached_server_by_key() allows you to provide a key and retrieve the
83 server which would be used for assignment. This structure is cloned
84 from its original structure and must be freed. If NULL is returned you
85 should consult *error. The returning structure should be freed with
86 memcached_server_free().
87
88 memcached_server_get_last_disconnect() returns a pointer to the last server
89 for which there was a connection problem. It does not mean this particular
90 server is currently dead but if the library is reporting a server is,
91 the returned server is a very good candidate.
92
93 memcached_server_cursor() takes a memcached_st and loops through the
94 list of hosts currently in the cursor calling the list of callback
95 functions provided. You can optionally pass in a value via
96 context which will be provided to each callback function. An error
97 return from any callback will terminate the loop. memcached_server_cursor()
98 is passed the original caller memcached_st in its current state.
99
100 =head1 RETURN
101
102 Varies, see particular functions.
103
104 =head1 HOME
105
106 To find out more information please check:
107 L<https://launchpad.net/libmemcached>
108
109 =head1 AUTHOR
110
111 Brian Aker, E<lt>brian@tangent.orgE<gt>
112
113 =head1 SEE ALSO
114
115 memcached(1) libmemcached(3) memcached_strerror(3)
116
117 =cut
118