Signal:Wait Asynchronous

  • KawaiiSignal:Wait
  • PsmSignal:Wait
  • VoltSignal:Wait

Suspend the calling coroutine until this signal fires, then receive that event’s arguments. Use it when the next step needs an event result rather than a persistent callback. Start waiting before firing the event; a previous event is not replayed.

Syntax
Luau
Signal:Wait() -> ...any

Parameters

Call this method with a Signal receiver. The colon supplies self implicitly; a dot call must pass the receiver explicitly.

This function takes no arguments.

Returns

...any

The complete argument tuple supplied to the next Fire call, preserving multiple return values.

Example

Example
Luau
local ready = Signal.new()
task.spawn(function()
    local name, count = ready:Wait()
    print(name, count)
end)
ready:Fire("imported", 3)
-- Allow the resumed waiter to finish before cleanup.
task.wait()
ready:Destroy()
Kawaii documentation