문법
RealSignal.Wait(signal: RealSignal): ....any인수
| 이름 | 타입 | 설명 |
|---|---|---|
signal | RealSignal | Signal object returned by Signal.new. |
반환값
| 이름 | 타입 | 설명 |
|---|---|---|
...values | ....any | All values passed to the Fire call that resumed the waiter. |
설명
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.
1개 파라미터로 호출합니다: signal. 인수 표는 필수 값과 동작을 조정하는 값을 설명합니다.
...values (....any)을 반환합니다. 반환 표를 사용해 성공 값, nil 결과, 복구 가능한 오류를 구분하세요.
예제
Yield until the signal fires and receive the fired values.
local signal = Signal.new()
task.spawn(function()
task.wait(1)
signal:Fire("done", 2)
end)
local status, count = signal:Wait()
print(status, count)타입
RealSignal
Signal object returned by Signal.new.
Connect (callback: (...any) -> ()) -> RealSignalConnection Adds a callback that runs when Fire is called.Once (callback: (...any) -> ()) -> RealSignalConnection Adds a callback that is disconnected before its first callback invocation.Wait () -> ...any Yields until Fire resumes the waiter with the fired values.Fire (...values: any) -> () Runs connected callbacks and resumes waiters with the provided values.