core (memory/persistent): added aset method in LazyPersistentBinaryDict:
this method does the same as `force` but is there to be consistent with PersistentDict. `force` should be removed in the future.
This commit is contained in:
parent
56d6613c4d
commit
973beb4220
1 changed files with 8 additions and 1 deletions
|
|
@ -27,7 +27,7 @@ class MemoryNotInitializedError(Exception):
|
|||
pass
|
||||
|
||||
|
||||
class PersistentDict(object):
|
||||
class PersistentDict:
|
||||
r"""A dictionary which save persistently each value assigned
|
||||
|
||||
/!\ be careful, each assignment means a database write
|
||||
|
|
@ -250,6 +250,13 @@ class LazyPersistentBinaryDict(PersistentBinaryDict):
|
|||
d.addErrback(self._defaultOrException, default=default)
|
||||
return d
|
||||
|
||||
def aset(self, key, value):
|
||||
"""Async set, return a Deferred fired when value is actually stored"""
|
||||
# FIXME: redundant with force, force must be removed
|
||||
# XXX: similar as PersistentDict.aset, but doesn't use cache
|
||||
return self.storage.setPrivateValue(self.namespace, key, value,
|
||||
self.binary, self.profile)
|
||||
|
||||
def setdefault(self, key, default):
|
||||
raise NotImplementedError
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue