コード例 #1
0
ファイル: core.py プロジェクト: hansent/shove
 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()
コード例 #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()
コード例 #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
コード例 #4
0
ファイル: core.py プロジェクト: hansent/shove
 def __delitem__(self, key):
     try:
         self.sync()
     except AttributeError:
         pass
     exhaustcall(methodcaller('__delitem__', key), self._stores)
     try:
         del self._cache[key]
     except KeyError:
         pass
コード例 #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
コード例 #6
0
ファイル: core.py プロジェクト: hansent/shove
 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
コード例 #7
0
 def sync(self):
     '''Writes buffer to stores.'''
     exhaustcall(methodcaller('update', self._buffer), self._stores)
     self._buffer.clear()
コード例 #8
0
ファイル: core.py プロジェクト: hansent/shove
 def sync(self):
     '''Writes buffer to stores.'''
     exhaustcall(methodcaller('update', self._buffer), self._stores)
     self._buffer.clear()