Purpose

Async handles allow the user to “wakeup” the event loop and get a callback called from another thread.

new_async

uv.new_async( callback )

Initialize the handle. A NULL callback is allowed.

Parameters

Name Details
callback A callback function.

Examples

local async_handle = uv.new_async(function()
  -- Doing some work...
end )

async_send

uv.async_send( async_handle )

Wakeup the event loop and call the async handle’s callback.

Parameters

Name Details
async_handle Reference to an async handle.

Examples

uv.async_send( async_handle )

See also

The following API functionality applies to all handles:

handles