Merge Trunk
[awesomized/libmemcached] / docs / man / memcached_servers.3
1 .TH "MEMCACHED_SERVERS" "3" "June 17, 2011" "0.49" "libmemcached"
2 .SH NAME
3 memcached_servers \- libmemcached Documentation
4 .
5 .nr rst2man-indent-level 0
6 .
7 .de1 rstReportMargin
8 \\$1 \\n[an-margin]
9 level \\n[rst2man-indent-level]
10 level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
11 -
12 \\n[rst2man-indent0]
13 \\n[rst2man-indent1]
14 \\n[rst2man-indent2]
15 ..
16 .de1 INDENT
17 .\" .rstReportMargin pre:
18 . RS \\$1
19 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
20 . nr rst2man-indent-level +1
21 .\" .rstReportMargin post:
22 ..
23 .de UNINDENT
24 . RE
25 .\" indent \\n[an-margin]
26 .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
27 .nr rst2man-indent-level -1
28 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
29 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
30 ..
31 .\" Man page generated from reStructeredText.
32 .
33 .SH SYNOPSIS
34 .sp
35 #include <libmemcached/memcached.h>
36 .INDENT 0.0
37 .TP
38 .B memcached_server_fn
39 .UNINDENT
40 .INDENT 0.0
41 .TP
42 .B uint32_t memcached_server_count(memcached_st\fI\ *ptr\fP)
43 .UNINDENT
44 .INDENT 0.0
45 .TP
46 .B memcached_return_t memcached_server_add(memcached_st\fI\ *ptr\fP, const char\fI\ *hostname\fP, in_port_t\fI\ port\fP)
47 .UNINDENT
48 .INDENT 0.0
49 .TP
50 .B memcached_return_t memcached_server_add_udp(memcached_st\fI\ *ptr\fP, const char\fI\ *hostname\fP, in_port_t\fI\ port\fP)
51 .UNINDENT
52 .INDENT 0.0
53 .TP
54 .B memcached_return_t memcached_server_add_unix_socket(memcached_st\fI\ *ptr\fP, const char\fI\ *socket\fP)
55 .UNINDENT
56 .INDENT 0.0
57 .TP
58 .B memcached_return_t memcached_server_push(memcached_st\fI\ *ptr\fP, const memcached_server_st\fI\ *list\fP)
59 .UNINDENT
60 .INDENT 0.0
61 .TP
62 .B memcached_server_instance_st memcached_server_by_key(const memcached_st\fI\ *ptr\fP, const char\fI\ *key\fP, size_t\fI\ key_length\fP, memcached_return_t\fI\ *error\fP)
63 .UNINDENT
64 .INDENT 0.0
65 .TP
66 .B memcached_server_instance_st memcached_server_get_last_disconnect(const memcached_st\fI\ *ptr\fP)
67 .UNINDENT
68 .INDENT 0.0
69 .TP
70 .B memcached_return_t memcached_server_cursor(const memcached_st\fI\ *ptr\fP, const \fI\%memcached_server_fn\fP\fI\ *callback\fP, void\fI\ *context\fP, uint32_t\fI\ number_of_callbacks\fP)
71 .UNINDENT
72 .sp
73 compile and link with \-lmemcached
74 .SH DESCRIPTION
75 .sp
76 \fBlibmemcached\fP performs operations on a list of hosts. The order of
77 these hosts determine routing to keys. Functions are provided to add keys to
78 memcached_st structures. To manipulate lists of servers see
79 \fBmemcached_server_st()\fP.
80 .sp
81 \fI\%memcached_server_count()\fP provides you a count of the current
82 number of servers being used by a \fBmemcached_st\fP structure.
83 .sp
84 \fI\%memcached_server_add()\fP pushes a single TCP server into the
85 \fBmemcached_st\fP structure. This server will be placed at the end.
86 Duplicate servers are allowed, so duplication is not checked. Executing this
87 function with the \fBMEMCACHED_BEHAVIOR_USE_UDP\fP behavior set will
88 result in a \fBMEMCACHED_INVALID_HOST_PROTOCOL\fP.
89 .sp
90 \fI\%memcached_server_add_udp()\fP pushes a single UDP server into the
91 \fBmemcached_st\fP structure. This server will be placed at the end.
92 Duplicate servers are allowed, so duplication is not checked. Executing this
93 function with out setting the \fBMEMCACHED_BEHAVIOR_USE_UDP\fP behavior
94 will result in a \fBMEMCACHED_INVALID_HOST_PROTOCOL\fP.
95 .sp
96 \fI\%memcached_server_add_unix_socket()\fP pushes a single UNIX socket
97 into the \fBmemcached_st\fP structure. This UNIX socket will be placed
98 at the end. Duplicate servers are allowed, so duplication is not checked.
99 The length of the filename must be one character less then
100 \fBMEMCACHED_MAX_HOST_LENGTH\fP.
101 .sp
102 \fI\%memcached_server_push()\fP pushes an array of
103 \fBmemcached_server_st\fP into the \fBmemcached_st\fP structure.
104 These servers will be placed at the end. Duplicate servers are allowed, so
105 duplication is not checked. A copy is made of structure so the list provided
106 (and any operations on the list) are not saved.
107 .sp
108 \fI\%memcached_server_by_key()\fP allows you to provide a key and retrieve
109 the server which would be used for assignment. This structure is cloned from
110 its original structure and must be freed. If NULL is returned you should
111 consult *error. The returning structure should be freed with
112 \fBmemcached_server_free()\fP.
113 .sp
114 \fI\%memcached_server_get_last_disconnect()\fP returns a pointer to the
115 last server for which there was a connection problem. It does not mean this
116 particular server is currently dead but if the library is reporting a server
117 is, the returned server is a very good candidate.
118 .sp
119 \fI\%memcached_server_cursor()\fP takes a memcached_st and loops through
120 the list of hosts currently in the cursor calling the list of callback
121 functions provided. You can optionally pass in a value via context which
122 will be provided to each callback function. An error return from any
123 callback will terminate the loop. \fI\%memcached_server_cursor()\fP is
124 passed the original caller memcached_st in its current state.
125 .SH RETURN
126 .sp
127 Varies, see particular functions.
128 .SH HOME
129 .sp
130 To find out more information please check:
131 \fI\%http://libmemcached.org/\fP
132 .SH SEE ALSO
133 .sp
134 \fImemcached(1)\fP \fIlibmemcached(3)\fP \fImemcached_strerror(3)\fP
135 .SH AUTHOR
136 Brian Aker
137 .SH COPYRIGHT
138 2011, Brian Aker DataDifferential, http://datadifferential.com/
139 .\" Generated by docutils manpage writer.
140 .\"
141 .