class Symphony::AwaitableSignal
- Symphony::AwaitableSignal
- Reference
- Object
Defined in:
symphony/awaitable_signal.crInstance Method Summary
-
#done! : Bool
Marks the signal as completed.
-
#done? : Bool
Nonblocking check if the signal is completed.
-
#wait : Nil
Block until completed.
-
#wait_or_timeout(max_wait : Time::Span | Nil) : Nil
Waits for completions (0 disables the timeout).
Instance Method Detail
def done! : Bool
#
Marks the signal as completed. All fibers that are waiting for it will be woken up.
Calling it multiple times is safe. The first call will return true, but
all calls after that will return false.
def wait_or_timeout(max_wait : Time::Span | Nil) : Nil
#
Waits for completions (0 disables the timeout). If it is already completed, it will return immediately.