1 | /*! *****************************************************************************
|
2 | Copyright (c) Microsoft Corporation.
|
3 | Licensed under the Apache License, Version 2.0.
|
4 |
|
5 | See LICENSE file in the project root for details.
|
6 | ***************************************************************************** */
|
7 | import { CancellationToken } from "./cancellation";
|
8 | import { Cancelable } from "@esfx/cancelable";
|
9 | /**
|
10 | * Asynchronously notifies one or more waiting Promises that an event has occurred.
|
11 | */
|
12 | export declare class Pulsar {
|
13 | private _waiters;
|
14 | /**
|
15 | * Notifies the next waiter.
|
16 | */
|
17 | pulse(): void;
|
18 | /**
|
19 | * Notifies all waiters.
|
20 | */
|
21 | pulseAll(): void;
|
22 | /**
|
23 | * Asynchronously waits for the the next pulse.
|
24 | *
|
25 | * @param token A CancellationToken used to cancel the request.
|
26 | */
|
27 | wait(token?: CancellationToken | Cancelable): Promise<void>;
|
28 | }
|