Exemplo n.º 1
0
 def sync(self):
     '''Writes buffer to store.'''
     with ThreadPoolExecutor(max_workers=self._maxworkers) as executor:
         method = partial(
             executor.submit, methodcaller('update', self._buffer),
         )
         exhaustcall(method, self._stores)
     self._buffer.clear()
Exemplo n.º 2
0
 def sync(self):
     '''Writes buffer to store.'''
     with ThreadPoolExecutor(max_workers=self._maxworkers) as executor:
         method = partial(
             executor.submit,
             methodcaller('update', self._buffer),
         )
         exhaustcall(method, self._stores)
     self._buffer.clear()
Exemplo n.º 3
0
 def __delitem__(self, key):
     try:
         self.sync()
     except AttributeError:
         pass
     exhaustcall(methodcaller('__delitem__', key), self._stores)
     try:
         del self._cache[key]
     except KeyError:
         pass
Exemplo n.º 4
0
 def __delitem__(self, key):
     try:
         self.sync()
     except AttributeError:
         pass
     exhaustcall(methodcaller('__delitem__', key), self._stores)
     try:
         del self._cache[key]
     except KeyError:
         pass
Exemplo n.º 5
0
 def __delitem__(self, key):
     try:
         self.sync()
     except AttributeError:
         pass
     with ThreadPoolExecutor(max_workers=self._maxworkers) as executor:
         method = partial(executor.submit, methodcaller('__delitem__', key))
         exhaustcall(method, self._stores)
     try:
         del self._cache[key]
     except KeyError:
         pass
Exemplo n.º 6
0
 def __delitem__(self, key):
     try:
         self.sync()
     except AttributeError:
         pass
     with ThreadPoolExecutor(max_workers=self._maxworkers) as executor:
         method = partial(
             executor.submit, methodcaller('__delitem__', key)
         )
         exhaustcall(method, self._stores)
     try:
         del self._cache[key]
     except KeyError:
         pass
Exemplo n.º 7
0
 def sync(self):
     '''Writes buffer to stores.'''
     exhaustcall(methodcaller('update', self._buffer), self._stores)
     self._buffer.clear()
Exemplo n.º 8
0
 def sync(self):
     '''Writes buffer to stores.'''
     exhaustcall(methodcaller('update', self._buffer), self._stores)
     self._buffer.clear()