本文整理汇总了Python中inbox.transactions.actions.SyncbackService.start方法的典型用法代码示例。如果您正苦于以下问题:Python SyncbackService.start方法的具体用法?Python SyncbackService.start怎么用?Python SyncbackService.start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类inbox.transactions.actions.SyncbackService
的用法示例。
在下文中一共展示了SyncbackService.start方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: syncback_service
# 需要导入模块: from inbox.transactions.actions import SyncbackService [as 别名]
# 或者: from inbox.transactions.actions.SyncbackService import start [as 别名]
def syncback_service():
from inbox.transactions.actions import SyncbackService
s = SyncbackService(poll_interval=0, retry_interval=0)
s.start()
yield s
s.stop()
s.join()
示例2: syncback_service
# 需要导入模块: from inbox.transactions.actions import SyncbackService [as 别名]
# 或者: from inbox.transactions.actions.SyncbackService import start [as 别名]
def syncback_service():
# aggressive=False used to avoid AttributeError in other tests, see
# https://groups.google.com/forum/#!topic/gevent/IzWhGQHq7n0
# TODO(emfree): It's totally whack that monkey-patching here would affect
# other tests. Can we make this not happen?
monkey.patch_all(aggressive=False)
from inbox.transactions.actions import SyncbackService
s = SyncbackService(poll_interval=0, retry_interval=0)
s.start()
yield s
s.stop()
示例3: mock_syncback_service
# 需要导入模块: from inbox.transactions.actions import SyncbackService [as 别名]
# 或者: from inbox.transactions.actions.SyncbackService import start [as 别名]
def mock_syncback_service():
"""Running SyncbackService with a mock queue."""
from inbox.transactions.actions import SyncbackService
from gevent import monkey
# aggressive=False used to avoid AttributeError in other tests, see
# https://groups.google.com/forum/#!topic/gevent/IzWhGQHq7n0
# TODO(emfree): It's totally whack that monkey-patching here would affect
# other tests. Can we make this not happen?
monkey.patch_all(aggressive=False)
s = SyncbackService(poll_interval=0)
s.queue = MockQueue()
s.start()
gevent.sleep()
assert len(s.queue) == 0
yield s
kill_greenlets()