Chromium Code Reviews| Index: chrome/common/extensions/docs/server2/memcache_object_store.py |
| diff --git a/chrome/common/extensions/docs/server2/memcache_object_store.py b/chrome/common/extensions/docs/server2/memcache_object_store.py |
| index 78d924166b3ff3da33d6632d81886b23d109e3a9..cb264705e7ae88da15dfd5bf02b26ef077d2d230 100644 |
| --- a/chrome/common/extensions/docs/server2/memcache_object_store.py |
| +++ b/chrome/common/extensions/docs/server2/memcache_object_store.py |
| @@ -5,9 +5,10 @@ |
| import logging |
| from appengine_wrappers import memcache |
| +from future import Future |
| from object_store import ObjectStore |
| -class _AsyncMemcacheGetFuture(object): |
| +class _AsyncMemcacheIOFuture(object): |
| def __init__(self, rpc): |
| self._rpc = rpc |
| @@ -22,16 +23,18 @@ class MemcacheObjectStore(ObjectStore): |
| # talking_alarm_clock always fails because the zip is too big. |
| # TODO(kalman): store example zips in blobstore. |
| if any(key.find('talking_alarm_clock') != -1 for key in mapping.iterkeys()): |
| - return |
| + return Future(callback=lambda: None) |
|
not at google - send to devlin
2014/10/23 20:00:19
Any reason why this isn't Future(value=None)?
Ken Rockot(use gerrit already)
2014/10/23 20:16:18
Yes. The reason is that I'm bad at Future. Fixed.
|
| try: |
| - memcache.Client().set_multi_async(mapping, namespace=self._namespace) |
| + rpc = memcache.Client().set_multi_async(mapping, |
| + namespace=self._namespace) |
| + return _AsyncMemcacheIOFuture(rpc) |
| except ValueError as e: |
| logging.error('Caught "ValueError: %s" when mapping keys %s' % ( |
| e, mapping.keys())) |
| def GetMulti(self, keys): |
| rpc = memcache.Client().get_multi_async(keys, namespace=self._namespace) |
| - return _AsyncMemcacheGetFuture(rpc) |
| + return _AsyncMemcacheIOFuture(rpc) |
| def DelMulti(self, keys): |
| memcache.delete_multi(keys, namespace=self._namespace) |