Esempio n. 1
0
def create_task(coro):
    if not hasattr(coro, "send"):
        raise TypeError("coroutine expected")
    t = Task(coro, globals())
    _task_queue.push_head(t)
    return t
Esempio n. 2
0
 def run_forever():
     global _stop_task
     _stop_task = Task(_stopper(), globals())
     run_until_complete(_stop_task)
Esempio n. 3
0
 def run_forever(run_once=False):
     global _stop_task
     _stop_task = Task(_stopper(), globals())
     run_until_complete(_stop_task, run_once=run_once)