Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ExecuteAsync

Deprecated: This function is deprecated in favor of ExecuteInGameThreadWithDelay. The new function provides cancellation, pause/resume, and state querying capabilities. See the migration guide for details.

The ExecuteAsync function asynchronously executes the supplied callback.

It works in a similar manner to ExecuteWithDelay, except that there is no delay beyond the cost of registering the callback.

Parameters

#TypeInformation
1functionThe callback to execute

Example

ExecuteAsync(function()
    print("Executed asynchronously\n")
end)
-- Executes on the game thread on the next frame/ProcessEvent
local handle = ExecuteInGameThreadWithDelay(0, function()
    print("Executed on game thread\n")
end)
-- Can now cancel with: CancelDelayedAction(handle)