RealSignal
RealSignal.Wait
Yields the current thread until the RealSignal is fired, then resumes with the arguments passed to Fire. It errors when called from a context that cannot yield.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Yields the current thread until the RealSignal is fired, then resumes with the arguments passed to Fire. It errors when called from a context that cannot yield.
RealSignal.Wait(signal: RealSignal): ....any
| Name | Type | Required | Açıklama |
|---|---|---|---|
Connect | (callback: (...any) -> ()) -> RealSignalConnection | Yes | Adds a callback that runs when Fire is called. |
Once | (callback: (...any) -> ()) -> RealSignalConnection | Yes | Adds a callback that is disconnected before its first callback invocation. |
Wait | () -> ...any | Yes | Yields until Fire resumes the waiter with the fired values. |
Fire | (...values: any) -> () | Yes | Runs connected callbacks and resumes waiters with the provided values. |
local signal = Signal.new()
task.spawn(function()
task.wait(1)
signal:Fire("done", 2)
end)
local status, count = signal:Wait()
print(status, count)