~piotr-sikora/libmemcached/fix-tests-on-openbsd

« back to all changes in this revision

Viewing changes to docs/memcached_callback.rst

  • Committer: Brian Aker
  • Date: 2011-04-28 00:30:03 UTC
  • mfrom: (929.1.88 libmemcached-build2)
  • Revision ID: brian@tangent.org-20110428003003-bm1qzgmg9kaawp5d
Merge in code for C++ compiling of libmemcached.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
memcached_callback_set() changes the function/structure assigned by a
42
42
callback flag. No connections are reset.
43
43
 
44
 
You can use MEMCACHED_CALLBACK_USER_DATA to provide custom context if required for any 
45
 
of the callbacks
 
44
You can use MEMCACHED_CALLBACK_USER_DATA to provide custom context if required for any of the callbacks.
46
45
 
47
46
 
48
47
.. c:var:: MEMCACHED_CALLBACK_CLEANUP_FUNCTION
49
48
 
50
 
 When memcached_delete() is called this function will be excuted. At the
51
 
 point of its execution all connections have been closed.
 
49
When memcached_delete() is called this function will be excuted. At the point of its execution all connections are closed.
52
50
 
53
51
 
54
52
 
55
53
.. c:var:: MEMCACHED_CALLBACK_CLONE_FUNCTION
56
54
 
57
 
 When memcached_delete() is called this function will be excuted. At the
58
 
 point of its execution all connections have been closed.
 
55
When memcached_delete() is called this function will be excuted. At the
 
56
point of its execution all connections are closed.
59
57
 
60
58
 
61
59
 
62
60
.. c:var:: MEMCACHED_CALLBACK_PREFIX_KEY
63
61
 
64
 
 You can set a value which will be used to create a domain for your keys.
65
 
 The value specified here will be prefixed to each of your keys. The value can not
66
 
 be greater then MEMCACHED_PREFIX_KEY_MAX_SIZE - 1 and will reduce MEMCACHED_MAX_KEY by
67
 
 the value of your key. The prefix key is only applied to the primary key,
68
 
 not the master key. MEMCACHED_FAILURE will be returned if no key is set. In the case
69
 
 of a key which is too long MEMCACHED_BAD_KEY_PROVIDED will be returned.
 
62
You can set a value which will be used to create a domain for your keys.
 
63
The value specified here will be prefixed to each of your keys. The value can not be greater then MEMCACHED_PREFIX_KEY_MAX_SIZE - 1 and will reduce MEMCACHED_MAX_KEY by the value of your key. 
 
64
 
 
65
The prefix key is only applied to the primary key, not the master key. MEMCACHED_FAILURE will be returned if no key is set. In the case of a key which is too long, MEMCACHED_BAD_KEY_PROVIDED will be returned.
70
66
 
71
 
 If you set a value with the value being NULL then the prefix key is disabled.
 
67
If you set a value with the value being NULL then the prefix key is disabled.
72
68
 
73
69
 
74
70
.. c:var:: MEMCACHED_CALLBACK_USER_DATA
75
71
 
76
 
 This allows you to store a pointer to a specifc piece of data. This can be
77
 
 retrieved from inside of memcached_fetch_execute(). Cloning a memcached_st
78
 
 will copy the pointer to the clone.
 
72
This allows you to store a pointer to a specifc piece of data. This can be
 
73
retrieved from inside of memcached_fetch_execute(). Cloning a memcached_st
 
74
will copy the pointer to the clone.
79
75
 
80
76
 
81
77
 
82
78
.. c:var:: MEMCACHED_CALLBACK_MALLOC_FUNCTION
83
79
 
84
 
 DEPRECATED: use memcached_set_memory_allocators instead.
 
80
DEPRECATED: use memcached_set_memory_allocators instead.
85
81
 
86
82
 
87
83
 
88
84
.. c:var:: MEMCACHED_CALLBACK_REALLOC_FUNCTION
89
85
 
90
 
 DEPRECATED: use memcached_set_memory_allocators instead.
 
86
DEPRECATED: use memcached_set_memory_allocators instead.
91
87
 
92
88
 
93
89
 
94
90
.. c:var:: MEMCACHED_CALLBACK_FREE_FUNCTION
95
91
 
96
 
 DEPRECATED: use memcached_set_memory_allocators instead.
 
92
DEPRECATED: use memcached_set_memory_allocators instead.
97
93
 
98
94
 
99
95
 
100
96
.. c:var:: MEMCACHED_CALLBACK_GET_FAILURE
101
97
 
102
 
 This function implements the read through cache behavior. On failure of retrieval this callback will be called. 
103
 
 You are responsible for populating the result object provided. This result object will then be stored in the server and
104
 
 returned to the calling process. You must clone the memcached_st in order to
105
 
 make use of it. The value will be stored only if you return
106
 
 MEMCACHED_SUCCESS or MEMCACHED_BUFFERED. Returning MEMCACHED_BUFFERED will
107
 
 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).
 
98
This function implements the read through cache behavior. On failure of retrieval this callback will be called. 
 
99
 
 
100
You are responsible for populating the result object provided. This result object will then be stored in the server and returned to the calling process. 
 
101
 
 
102
You must clone the memcached_st in order to
 
103
make use of it. The value will be stored only if you return
 
104
MEMCACHED_SUCCESS or MEMCACHED_BUFFERED. Returning MEMCACHED_BUFFERED will
 
105
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).
108
106
 
109
 
 The prototype for this is:
110
 
 memcached_return_t (\*memcached_trigger_key)(memcached_st \*ptr, char \*key, size_t key_length, memcached_result_st \*result);
 
107
The prototype for this is:
 
108
memcached_return_t (\*memcached_trigger_key)(memcached_st \*ptr, char \*key, size_t key_length, memcached_result_st \*result);
111
109
 
112
110
 
113
111