Async – async handle

class uv.Async(loop=None, callback=None)[source]

Async handles will wake-up the event loop from an other thread and run the given callback within the event loop’s thread. They are the only thread-safe handles.

Raises:

uv.UVError – error during the initialization of the handle

Parameters:
  • loop (uv.Loop) – event loop which should be used for the handle
  • callback ((uv.Async) -> None) – callback which should be called from within the event loop
callback

Callback which should be called from within the event loop.

callback(Async-Handle)
Readonly:False
Type:(uv.Async) -> None
send(callback=None)[source]

Wake-up the event loop and execute the callback afterwards. Multiple calls to this method are coalesced if they happen before the callback has been called. This means not every call will yield a execution of the callback.

Raises:
Parameters:

callback ((uv.Async) -> None) – callback which should be called from within the event loop