Example #1
0
File: core.py Project: lcrees/shove
 def __delitem__(self, key):
     try:
         self.sync()
     except AttributeError:
         pass
     exhaustmap(methodcaller("__delitem__", key), self._stores)
     try:
         del self._cache[key]
     except KeyError:
         pass
Example #2
0
 def __delitem__(self, key):
     try:
         self.sync()
     except AttributeError:
         pass
     exhaustmap(methodcaller('__delitem__', key), self._stores)
     try:
         del self._cache[key]
     except KeyError:
         pass
Example #3
0
File: core.py Project: lcrees/shove
 def sync(self):
     """Writes buffer to stores."""
     exhaustmap(methodcaller("update", self._buffer), self._stores)
     self._buffer.clear()
Example #4
0
 def sync(self):
     '''Writes buffer to stores.'''
     exhaustmap(methodcaller('update', self._buffer), self._stores)
     self._buffer.clear()
Example #5
0
 def test_exhaustmap(self):
     from stuf import exhaustmap
     deferred = exhaustmap(lambda x: x + x, iter([1, 2, 3]), StopIteration)
     self.assertIsNone(deferred)
Example #6
0
 def sync(self):
     '''Writes buffer to stores.'''
     exhaustmap(methodcaller('update', self._buffer), self._stores)
     self._buffer.clear()