Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

PYCBC-18: added append function to the python client

Change-Id: If5a7a424f5a6bfef0210fb7fc102f4665561913e
  • Loading branch information...
commit 733e84809edc7c343b43173507056534f4d22a0e 1 parent 0680cfe
@farshidce farshidce authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 couchbase/couchbaseclient.py
View
16 couchbase/couchbaseclient.py
@@ -871,6 +871,13 @@ def add(self, key, expiry, flags, value):
self.dispatcher.put(item)
return self._respond(item, event)
+ def append(self, key, value, cas=0):
+ event = Event()
+ item = {"operation": "append", "key": key, "cas": cas, "value": value, "event": event,
+ "response": {}}
+ self.dispatcher.put(item)
+ return self._respond(item, event)
+
def delete(self, key, cas=0):
event = Event()
item = {"operation": "delete", "key": key, "cas": cas, "event": event,
@@ -1060,6 +1067,15 @@ def do(self, item):
except Exception as ex:
self._raise_if_recoverable(ex, item)
item["event"].set()
+ elif item["operation"] == "append":
+ key = item["key"]
+ cas = item["cas"]
+ value = item["value"]
+ try:
+ item["response"]["return"] = self.vbaware.memcached(key,item["fastforward"]).append(key, value, cas)
+ except Exception as ex:
+ self._raise_if_recoverable(ex, item)
+ item["event"].set()
elif item["operation"] == "getl":
key = item["key"]
expiry = item["expiry"]
Please sign in to comment.
Something went wrong with that request. Please try again.