Actors

run_on_thread

Runs source code on a specific thread context.

Syntax

run_on_thread(thread: thread, source: string, ...arguments?: ...any)
Aliases runonthread

Arguments

NameTypeDescription
threadthreadThread to inspect or run inside.
sourcestringSource value used by the operation.
...arguments?...anyArguments forwarded to the target signal, actor, thread, or function.

Description

Runs source code on a specific thread context.

Call it with 3 parameter(s): thread, source, ...arguments. The argument table explains which values are required and which ones only refine the behavior.

It does not return data. Treat the call as an action and handle errors around the call site when needed.

Example

Example call with placeholder values.

run_on_thread(coroutine.running(), "example", nil)