You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the return value is always None.
but we sometimes really need the return value of the internal cache object 's operations.
for example, we can use memcache.add as a distributed lock to guarantee atomic operations:
if memcache.add(key, value):
do_something_exclusively
else:
# someone else is doing the same thing
pass
but without the retuen value, we have to use cache.cache.add.
So, would you consider this and change the proxy functions like this:
def add(self, *args, **kwargs):
"Proxy function for internal cache object."
- self.cache.add(*args, **kwargs)
+ return self.cache.add(*args, **kwargs)
or is there some other reason to keep discarding interal operation's return value ?
The text was updated successfully, but these errors were encountered:
for the proxy functions as following
the return value is always None.
but we sometimes really need the return value of the internal cache object 's operations.
for example, we can use
memcache.add
as a distributed lock to guarantee atomic operations:but without the retuen value, we have to use
cache.cache.add
.So, would you consider this and change the proxy functions like this:
or is there some other reason to keep discarding interal operation's return value ?
The text was updated successfully, but these errors were encountered: