本文整理汇总了Python中ucollections.deque方法的典型用法代码示例。如果您正苦于以下问题:Python ucollections.deque方法的具体用法?Python ucollections.deque怎么用?Python ucollections.deque使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ucollections
的用法示例。
在下文中一共展示了ucollections.deque方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import ucollections [as 别名]
# 或者: from ucollections import deque [as 别名]
def __init__(self, runq_len=16, waitq_len=16, ioq_len=0, lp_len=0):
self.runq = ucollections.deque((), runq_len, True)
self._max_od = 0
self.lpq = utimeq.utimeq(lp_len) if lp_len else None
self.ioq_len = ioq_len
self.canned = set()
if ioq_len:
self.ioq = ucollections.deque((), ioq_len, True)
self._call_io = self._call_now
else:
self._call_io = self.call_soon
self.waitq = utimeq.utimeq(waitq_len)
# Current task being run. Task is a top-level coroutine scheduled
# in the event loop (sub-coroutines executed transparently by
# yield from/await, event loop "doesn't see" them).
self.cur_task = None
示例2: __init__
# 需要导入模块: import ucollections [as 别名]
# 或者: from ucollections import deque [as 别名]
def __init__(self, runq_len=16, waitq_len=16):
self.runq = ucollections.deque((), runq_len, True)
self.waitq = utimeq.utimeq(waitq_len)
# Current task being run. Task is a top-level coroutine scheduled
# in the event loop (sub-coroutines executed transparently by
# yield from/await, event loop "doesn't see" them).
self.cur_task = None
示例3: __init__
# 需要导入模块: import ucollections [as 别名]
# 或者: from ucollections import deque [as 别名]
def __init__(self, maxsize=0):
super().__init__()
self.maxsize = maxsize
self._queue = deque((), maxsize)