RealSignal

RealSignal.Wait

Yields the current thread until the RealSignal is fired, then resumes with the arguments passed to Fire.

문법

RealSignal.Wait(signal: RealSignal): ....any

인수

이름타입설명
signalRealSignalSignal object returned by Signal.new.

반환값

이름타입설명
...values....anyAll 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.