示例#1
0
 def __init__(self, interval=(24 * 60 * 60)):
     cleanup = synchronous(transactional(cleanup_old_nonces))
     super().__init__(interval, deferToDatabase, cleanup)
示例#2
0
文件: monkey.py 项目: ddstreet/maas
 def new_deferToThreadPool(reactor, threadpool, f, *args, **kwargs):
     """Variant of Twisted's that wraps all functions in `synchronous`."""
     func = f if ISynchronous.providedBy(f) else synchronous(f)
     return deferToThreadPool(reactor, threadpool, func, *args, **kwargs)