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()
def __delitem__(self, key): try: self.sync() except AttributeError: pass exhaustcall(methodcaller('__delitem__', key), self._stores) try: del self._cache[key] except KeyError: pass
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
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
def sync(self): '''Writes buffer to stores.''' exhaustcall(methodcaller('update', self._buffer), self._stores) self._buffer.clear()