Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)

        def scheduler(tasks=None):
    if tasks is None:
        tasks = _SCHEDULED_TASKS
    now = time.time()
    while tasks and now >= tasks[0].timeout:
        call = heapq.heappop(tasks)
        if call.repush:
            heapq.heappush(tasks, call)
            call.repush = False
            continue
        try:
            call.call()
        finally:
            if not call.cancelled:
                call.cancel()
        


src/a/s/astm-0.5.0/astm/tests/test_asynclib.py   astm(Download)
    def scheduler(self, timeout=0.01, count=100):
        while asynclib._SCHEDULED_TASKS and count > 0:
            asynclib.scheduler()
            count -= 1
            time.sleep(timeout)