An alternative to forSignal, returning true if signalled, or false if wait period was exceeded
const s = await sw.didSignal(5000);
Throw away any previous signalled state. This will cause any currently waiters to throw
Call with await
to wait until .signal() happens.
If a wait period is specified, an exception is thrown if signal does not happen within this time.
Optional
maximumWaitMs: number
Simple synchronisation. Supports only a single signal/waiter. Expects one or more calls to .signal() for .forSignal() to resolve
forSignal
can also take a maximum time to wait. If the time elapses, an exception is thrown.didSignal returns true/false if signal happened rather than throwing an exception.