AcediaDocumentation

Signal

Executor-owned signals and their connection handles.

Created by Signal.new and used by DrawingImmediate paint signals.

MemberType / signatureMeaning
ConnectConnect(callback): SignalConnectionRegisters a persistent callback.
OnceOnce(callback): SignalConnectionRegisters a callback removed on the first fire.
FireFire(...): ()Invokes handlers through protected calls and releases waiting calls; at most 16 argument values are carried.
WaitWait(): ...anyYields until the signal fires, then returns its argument values.

Lowercase connect, once, fire and wait aliases are available. Returned SignalConnection tables expose Connected and Disconnect() (also disconnect). They are not the engine inspection records returned by getconnections. Handler errors are isolated by protected calls.

local signal = Signal.new()
local connection = signal:Once(function(value) print(value) end)
signal:Fire("example")

A signal object belongs to the VM and world in which it was made. Recreate it after a world change.