@atomist/automation-client
Version:
Atomist API for software low-level client
19 lines • 778 B
TypeScript
/**
* Run a function periodically until it returns true or until the
* timeout expires. Its polling period is 1/10th the timeout. If the
* timeout expires before the function returns true, the Promise will
* be rejected. The function will be tried immediately and when the
* total duration is reached.
*
* @param fn Function to call periodically
* @param duration Total length of time to poll in millisends
* @return Resolved Promise if function returns true within the timeout period, rejected Promise if not
*/
export declare function poll(fn: () => boolean, duration?: number): Promise<void>;
/**
* Async sleep function.
*
* @param ms Sleep time in milliseconds.
*/
export declare function sleep(ms: number): Promise<void>;
//# sourceMappingURL=poll.d.ts.map