Mercurial > hg > memcached
comparison memcached.h @ 2:e28ab6bd21fa
Append/prepend commands.
Introduce new storage commands "append" and "prepend" for atomic value
modification. They follow generic storage commands interface as described in
doc/protocol.txt:
<command name> <key> <flags> <exptime> <bytes>\r\n
<data block>\r\n
Current implementation involves memcpy() twice to combine values on writing
(i.e. full resulting value are copied), but truly atomic (and even threadsafe).
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Sun, 30 Sep 2007 04:14:57 +0400 |
parents | 30782bb1fc04 |
children |
comparison
equal
deleted
inserted
replaced
1:7ba3a424d509 | 2:e28ab6bd21fa |
---|---|
132 }; | 132 }; |
133 | 133 |
134 #define NREAD_ADD 1 | 134 #define NREAD_ADD 1 |
135 #define NREAD_SET 2 | 135 #define NREAD_SET 2 |
136 #define NREAD_REPLACE 3 | 136 #define NREAD_REPLACE 3 |
137 #define NREAD_APPEND 4 | |
138 #define NREAD_PREPEND 5 | |
137 | 139 |
138 typedef struct { | 140 typedef struct { |
139 int sfd; | 141 int sfd; |
140 int state; | 142 int state; |
141 struct event event; | 143 struct event event; |