Skip to content
Actors & channelsOverviewNew · 0.744

run_on_thread

Represents execution associated with a thread context.

Aliasesrunonthread

Details#

Compiles source and schedules a new execution in the supplied thread's context, forwarding extra arguments. Does not resume the supplied coroutine body or return the scheduled chunk's results.

Examples#

Example

Luau
local thread = coroutine.create(function() end)
local ok, err = pcall(run_on_thread, thread, "print(6 * 7)")
if not ok then warn(err) end