AcediaDocumentation

run_on_actor

Schedules source code in a VM selected by a Actor.

The source is compiled and scheduled on an executor thread in the target VM. It does not synchronously return the chunk's results or resume the supplied thread at its previous instruction. Cross-VM values must be supported by the value copier.

run_on_actor(target: Actor, source: string, ...: any): ()

Parameters

ParameterTypeDescription
targetActorTarget Actor or thread.
sourcestringLuau source compiled in the target VM.
...anyArguments copied to the target chunk.

Example

local function runExample(target)
    run_on_actor(target, "local value = ...; print(value)", "example")
end

Example output

example

The chunk runs in the actor's VM, so the print is routed through that VM's output channel.

Errors: Missing or foreign target VMs, unsupported argument copies and compilation/scheduling failures raise errors.

Aliases: runonactor.

On this page