Update docs.
[m6w6/libmemcached] / docs / man / memcached_callback_get.3
1 .TH "MEMCACHED_CALLBACK_GET" "3" "April 08, 2011" "0.47" "libmemcached"
2 .SH NAME
3 memcached_callback_get \- 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 .sp
34 Get and set a callback
35 .SH LIBRARY
36 .sp
37 C Client Library for memcached (libmemcached, \-lmemcached)
38 .SH SYNOPSIS
39 .sp
40 .nf
41 .ft C
42 #include <libmemcached/memcached.h>
43
44 memcached_return_t
45 memcached_callback_set (memcached_st *ptr,
46 memcached_callback_t flag,
47 void *data);
48
49 void *
50 memcached_callback_get (memcached_st *ptr,
51 memcached_callback_t flag,
52 memcached_return_t *error);
53 .ft P
54 .fi
55 .SH DESCRIPTION
56 .sp
57 libmemcached(3) can have callbacks set key execution points. These either
58 provide function calls at points in the code, or return pointers to
59 structures for particular usages.
60 .sp
61 memcached_callback_get() takes a callback flag and returns the structure or
62 function set by memcached_callback_set().
63 .sp
64 memcached_callback_set() changes the function/structure assigned by a
65 callback flag. No connections are reset.
66 .sp
67 You can use MEMCACHED_CALLBACK_USER_DATA to provide custom context if required for any
68 of the callbacks
69 .sp
70 MEMCACHED_CALLBACK_CLEANUP_FUNCTION
71 .INDENT 0.0
72 .INDENT 3.5
73 .sp
74 When memcached_delete() is called this function will be excuted. At the
75 point of its execution all connections have been closed.
76 .UNINDENT
77 .UNINDENT
78 .sp
79 MEMCACHED_CALLBACK_CLONE_FUNCTION
80 .INDENT 0.0
81 .INDENT 3.5
82 .sp
83 When memcached_delete() is called this function will be excuted. At the
84 point of its execution all connections have been closed.
85 .UNINDENT
86 .UNINDENT
87 .sp
88 MEMCACHED_CALLBACK_PREFIX_KEY
89 .INDENT 0.0
90 .INDENT 3.5
91 .sp
92 You can set a value which will be used to create a domain for your keys.
93 The value specified here will be prefixed to each of your keys. The value can not
94 be greater then MEMCACHED_PREFIX_KEY_MAX_SIZE \- 1 and will reduce MEMCACHED_MAX_KEY by
95 the value of your key. The prefix key is only applied to the primary key,
96 not the master key. MEMCACHED_FAILURE will be returned if no key is set. In the case
97 of a key which is too long MEMCACHED_BAD_KEY_PROVIDED will be returned.
98 .sp
99 If you set a value with the value being NULL then the prefix key is disabled.
100 .UNINDENT
101 .UNINDENT
102 .sp
103 MEMCACHED_CALLBACK_USER_DATA
104 .INDENT 0.0
105 .INDENT 3.5
106 .sp
107 This allows you to store a pointer to a specifc piece of data. This can be
108 retrieved from inside of memcached_fetch_execute(). Cloning a memcached_st
109 will copy the pointer to the clone.
110 .UNINDENT
111 .UNINDENT
112 .sp
113 MEMCACHED_CALLBACK_MALLOC_FUNCTION
114 .INDENT 0.0
115 .INDENT 3.5
116 .sp
117 DEPRECATED: use memcached_set_memory_allocators instead.
118 .UNINDENT
119 .UNINDENT
120 .sp
121 MEMCACHED_CALLBACK_REALLOC_FUNCTION
122 .INDENT 0.0
123 .INDENT 3.5
124 .sp
125 DEPRECATED: use memcached_set_memory_allocators instead.
126 .UNINDENT
127 .UNINDENT
128 .sp
129 MEMCACHED_CALLBACK_FREE_FUNCTION
130 .INDENT 0.0
131 .INDENT 3.5
132 .sp
133 DEPRECATED: use memcached_set_memory_allocators instead.
134 .UNINDENT
135 .UNINDENT
136 .sp
137 MEMCACHED_CALLBACK_GET_FAILURE
138 .INDENT 0.0
139 .INDENT 3.5
140 .sp
141 This function implements the read through cache behavior. On failure of retrieval this callback will be called.
142 You are responsible for populating the result object provided. This result object will then be stored in the server and
143 returned to the calling process. You must clone the memcached_st in order to
144 make use of it. The value will be stored only if you return
145 MEMCACHED_SUCCESS or MEMCACHED_BUFFERED. Returning MEMCACHED_BUFFERED will
146 cause the object to be buffered and not sent immediatly (if this is the default behavior based on your connection setup this will happen automatically).
147 .sp
148 The prototype for this is:
149 memcached_return_t (*memcached_trigger_key)(memcached_st *ptr, char *key, size_t key_length, memcached_result_st *result);
150 .UNINDENT
151 .UNINDENT
152 .sp
153 MEMCACHED_CALLBACK_DELETE_TRIGGER
154 .INDENT 0.0
155 .INDENT 3.5
156 .sp
157 This function implements a trigger upon successful deletion of a key. The memcached_st structure will need to be cloned
158 in order to make use of it.
159 .sp
160 The prototype for this is:
161 typedef memcached_return_t (*memcached_trigger_delete_key)(memcached_st *ptr, char *key, size_t key_length);
162 .UNINDENT
163 .UNINDENT
164 .SH RETURN
165 .sp
166 memcached_callback_get() return the function or structure that was provided.
167 Upon error, nothing is set, null is returned, and the memcached_return_t
168 argument is set to MEMCACHED_FAILURE.
169 .sp
170 memcached_callback_set() returns MEMCACHED_SUCCESS upon successful setting,
171 otherwise MEMCACHED_FAILURE on error.
172 .SH HOME
173 .sp
174 To find out more information please check:
175 \fI\%https://launchpad.net/libmemcached\fP
176 .SH AUTHOR
177 .sp
178 Brian Aker, <\fI\%brian@tangent.org\fP>
179 .SH SEE ALSO
180 .sp
181 memcached(1) libmemcached(3) memcached_strerror(3)
182 .SH AUTHOR
183 Brian Aker
184 .SH COPYRIGHT
185 2011, Brian Aker
186 .\" Generated by docutils manpage writer.
187 .\"
188 .