NativeSignal: Wait Asynchronous
Suspend until a Kawaii runtime event fires, then receive its arguments. Use it for a one-off event when you do not need a persistent callback.
Luau
NativeSignal:Wait() -> ...anyParameters
Call this method with a NativeSignal receiver. The colon supplies self implicitly; a dot call must pass the receiver explicitly.
This function takes no arguments.
Returns
...anyThe values emitted by the owning event.
Usage notes
Wait yields the calling coroutine. It may keep waiting if the event source never fires, so a callback can be easier when you need timeout or cancellation logic.
Example
Luau
local socket = WebSocket.connect("wss://echo.websocket.events")
socket:Send("ready?")
local reply = socket.OnMessage:Wait()
print(reply)
socket:Close()