Python ucollections.deque() Examples

The following are 7 code examples of ucollections.deque(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module ucollections , or try the search function .
Example #1
Source File: core.py    From micropython-async with MIT License 7 votes vote down vote up
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 
Example #2
Source File: core.py    From uPyCam with Apache License 2.0 5 votes vote down vote up
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 
Example #3
Source File: queue.py    From micropython-samples with MIT License 5 votes vote down vote up
def __init__(self, maxsize=0):
        super().__init__()
        self.maxsize = maxsize
        self._queue = deque((), maxsize) 
Example #4
Source File: core.py    From micropython-samples with MIT License 5 votes vote down vote up
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 
Example #5
Source File: core.py    From microdot with MIT License 5 votes vote down vote up
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 
Example #6
Source File: core.py    From pysmartnode with MIT License 5 votes vote down vote up
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 
Example #7
Source File: core.py    From microhomie with MIT License 5 votes vote down vote up
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