52
.B memcached_return_t memcached_prepend(memcached_st\fI\ *ptr\fP, const char\fI\ *key\fP, size_t\fI\ key_length\fP, const char\fI\ *value\fP, size_t\fI\ value_length\fP, time_t\fI\ expiration\fP, uint32_t\fI\ flags\fP)
56
.B memcached_return_t memcached_append(memcached_st\fI\ *ptr\fP, const char\fI\ *key\fP, size_t\fI\ key_length\fP, const char\fI\ *value\fP, size_t\fI\ value_length\fP, time_t\fI\ expiration\fP, uint32_t\fI\ flags\fP)
60
.B memcached_return_t memcached_cas(memcached_st *ptr, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags, uint64_t cas);
64
50
.B memcached_return_t memcached_set_by_key(memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags);
72
58
.B memcached_return_t memcached_replace_by_key(memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags);
76
.B memcached_return_t memcached_prepend_by_key(memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags);
80
.B memcached_return_t memcached_append_by_key(memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags);
84
.B memcached_return_t memcached_cas_by_key(memcached_st *ptr, const char *group_key, size_t group_key_length, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags, uint64_t cas);
87
61
Compile and link with \-lmemcached
90
64
memcached_set(), memcached_add(), and memcached_replace() are all used to
91
65
store information on the server. All methods take a key, and its length to
92
store the object. Keys are currently limited to 250 characters by the
93
memcached(1) server. You must also supply a value and a length. Optionally you
94
may tests an expiration time for the object and a 16 byte value (it is
95
meant to be used as a bitmap).
66
store the object. Keys are currently limited to 250 characters when using either a version of memcached(1) which is 1.4 or below, or when using the text protocol.
67
You must supply both a value and a length. Optionally you
68
may test an expiration time for the object and a 16 byte value (it is
69
meant to be used as a bitmap). "flags" is a 4byte space that is stored alongside of the main value. Many sub libraries make use of this field, so in most cases users should avoid making use of it.
97
71
memcached_set() will write an object to the server. If an object already
98
72
exists it will overwrite what is in the server. If the object does not exist
105
79
memcached_add() adds an object to the server. If the object is found on the
106
80
server an error occurs, otherwise the value is stored.
108
memcached_prepend() places a segment of data before the last piece of data
109
stored. Currently expiration and key are not used in the server.
111
memcached_append() places a segment of data at the end of the last piece of
112
data stored. Currently expiration and key are not used in the server.
114
82
memcached_cas() overwrites data in the server as long as the "cas" value is
115
83
still the same in the server. You can get the cas value of a result by
116
84
calling memcached_result_cas() on a memcached_result_st(3) structure. At the point
118
86
for it in libmemcached(3) is optional. Please see memcached_set() for
119
87
information on how to do this.
121
memcached_set_by_key(), memcached_add_by_key(), memcached_replace_by_key(),
122
memcached_prepend_by_key(), memcached_append_by_key_by_key(),
123
memcached_cas_by_key() methods all behave in a similar method as the non key
89
memcached_set_by_key(), memcached_add_by_key(), and memcached_replace_by_key()
90
methods all behave in a similar method as the non key
124
91
methods. The difference is that they use their group_key parameter to map
125
92
objects to particular servers.
127
94
If you are looking for performance, memcached_set() with non\-blocking IO is
128
95
the fastest way to store data on the server.
130
All of the above functions are testsed with the \fBMEMCACHED_BEHAVIOR_USE_UDP\fPbehavior enabled. But when using these operations with this behavior on, there
97
All of the above functions are testsed with the \fBMEMCACHED_BEHAVIOR_USE_UDP\fPbehavior enabled. However, when using these operations with this behavior on, there
131
98
are limits to the size of the payload being sent to the server. The reason for
132
these limits is that the Memcahed Server does not allow multi\-datagram requests
99
these limits is that the Memcached Server does not allow multi\-datagram requests
133
100
and the current server implementation sets a datagram size to 1400 bytes. Due
134
101
to protocol overhead, the actual limit of the user supplied data is less than
135
1400 bytes and depends on the protocol in use as well as the operation being
102
1400 bytes and depends on the protocol in use as, well as the operation being
136
103
executed. When running with the binary protocol, \(ga\(ga MEMCACHED_BEHAVIOR_BINARY_PROTOCOL\(ga\(ga,
137
104
the size of the key,value, flags and expiry combined may not exceed 1368 bytes.
138
105
When running with the ASCII protocol, the exact limit fluctuates depending on