本文整理汇总了Python中inbox.transactions.actions.SyncbackService.queue方法的典型用法代码示例。如果您正苦于以下问题:Python SyncbackService.queue方法的具体用法?Python SyncbackService.queue怎么用?Python SyncbackService.queue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类inbox.transactions.actions.SyncbackService
的用法示例。
在下文中一共展示了SyncbackService.queue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: mock_syncback_service
# 需要导入模块: from inbox.transactions.actions import SyncbackService [as 别名]
# 或者: from inbox.transactions.actions.SyncbackService import queue [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()