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
| # | Type | Information |
|---|---|---|
| 1 | function | The callback to execute |
Example
ExecuteAsync(function()
print("Executed asynchronously\n")
end)
Recommended Alternative
-- 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)