AsyncCountdownEvent Class
Package: @esfx/async-countdown
An event that is set when all participants have signaled.
Declaration
export declare class AsyncCountdownEvent
Constructors
constructor(initialCount)
Initializes a new instance of the CountdownEvent class.
Declaration
constructor(initialCount: number);
Parameters
Properties
initialCount
Gets the number of signals initially required to set the event.
Declaration
get initialCount(): number;
Property Value
remainingCount
Gets the number of remaining signals required to set the event.
Declaration
get remainingCount(): number;
Property Value
Methods
add(count)
Increments the event's current count by one or more.
Declaration
add(count?: number): void;
Parameters
- count
- number
An optional count specifying the additional number of signals for which the event will wait.
Returns
void
reset(count)
Resets the remaining and initial count to the specified value, or the initial count.
Declaration
reset(count?: number): void;
Parameters
Returns
void
signal(count)
Registers one or more signals with the CountdownEvent, decrementing the remaining count.
Declaration
signal(count?: number): boolean;
Parameters
Returns
wait(cancelable)
Asynchronously waits for the event to become signaled.
Declaration
wait(cancelable?: Cancelable): Promise<void>;
Parameters
Returns
Promise<void>