nuka

nuka.run

nuka.run(*coros, timeout=None)[source]

Run coroutines:

nuka.run(do_something(host)

nuka.wait

class nuka.wait(future, *futures, **kwargs)[source]

A task that wait for a coroutine / event / future:

nuka.wait(do_something(host), event)

You can use a timeout:

nuka.wait(event, timeout=30)

nuka.Event

class nuka.Event(name, loop=None)[source]

A named event that you can wait:

event = Event('myevent')

async def do_something(host):
    nuka.wait(event)

nuka.cancel_on_error

nuka.cancel_on_error(*futures)[source]

Cancel futures when the coroutine raise:

@cancel_on_error(event)
async def do_something(host):
    event.release()