Indicates whether the signal is in the signaled state.
Tests whether a subscriber is registered.
The subscriber function to check.
true if the subscriber is registered, false otherwise.
Protected
publishReset the signal to non-signaled state
Set the signal to signaled state
Registers a subscriber function to be called when the event is emitted.
If the subscriber is already registered, this method has no effect.
The subscriber function to call when the event is emitted.
Optional
options: SubscribableSubscribeOptionsOptional settings for the subscription.
A function that can be called to unsubscribe the subscriber, or null if the subscriber was already registered.
Unregisters a previously registered subscriber function.
If the subscriber is not registered, this method has no effect.
The subscriber function to remove.
Wait for the signal to be signaled.
If the signal is already signaled, the listener is called immediately.
If autoReset
is true, the signal is reset to non-signaled state after
notifying a listener.
Note: If multiple listeners are waiting and the signal is signaled, only one
listener will be notified if autoReset
is true. If autoReset
is false,
all listeners will be notified.
Optional
signal: null | AbortSignalAn AbortSignal that can be used to cancel the wait operation.
A promise that resolves when the signal is signaled, or rejects when aborted.
A synchronization primitive that can be in a signaled or non-signaled state.
When the signal is in the signaled state, calls to
wait
will resolve immediately. When the signal is in the non-signaled state, calls towait
will block until the signal is signaled.If
autoReset
is true, the signal will automatically reset to the non-signaled state after a single waiter is released. IfautoReset
is false, the signal will remain in the signaled state until it is manually reset.