asyncio.Handle.cancel()

cancel() Cancel the call. If the callback is already canceled or executed, this method has no effect.

asyncio.Handle

class asyncio.Handle A callback wrapper object returned by AbstractEventLoop.call_soon(), AbstractEventLoop.call_soon_threadsafe(), AbstractEventLoop.call_later(), and AbstractEventLoop.call_at(). cancel() Cancel the call. If the callback is already canceled or executed, this method has no effect.

asyncio.get_event_loop_policy()

asyncio.get_event_loop_policy() Get the current event loop policy.

asyncio.get_event_loop()

asyncio.get_event_loop() Equivalent to calling get_event_loop_policy().get_event_loop().

asyncio.gather()

asyncio.gather(*coros_or_futures, loop=None, return_exceptions=False) Return a future aggregating results from the given coroutine objects or futures. All futures must share the same event loop. If all the tasks are done successfully, the returned future’s result is the list of results (in the order of the original sequence, not necessarily the order of results arrival). If return_exceptions is True, exceptions in the tasks are treated the same as successful results, and gathered in the resu

asyncio.Future.set_result()

set_result(result) Mark the future done and set its result. If the future is already done when this method is called, raises InvalidStateError.

asyncio.Future.set_exception()

set_exception(exception) Mark the future done and set an exception. If the future is already done when this method is called, raises InvalidStateError.

asyncio.Future.result()

result() Return the result this future represents. If the future has been cancelled, raises CancelledError. If the future’s result isn’t yet available, raises InvalidStateError. If the future is done and has an exception set, this exception is raised.

asyncio.Future.remove_done_callback()

remove_done_callback(fn) Remove all instances of a callback from the “call when done” list. Returns the number of callbacks removed.

asyncio.Future.exception()

exception() Return the exception that was set on this future. The exception (or None if no exception was set) is returned only if the future is done. If the future has been cancelled, raises CancelledError. If the future isn’t done yet, raises InvalidStateError.