Namespace: promise

qui.utils.promise

Methods

(static) asap() → {Promise}

Return a promise that resolves as soon as possible, in the next main loop iteration.

Source:
Returns:
Type
Promise

(static) later(timeout, argopt) → {Promise}

Return a promise that resolves later, after a specified number of seconds.

Parameters:
Name Type Attributes Description
timeout Number

the timeout, in milliseconds

arg * <optional>

an optional argument to pass along the promise chain

Source:
Returns:
Type
Promise

(static) withTimeout(promise, timeout) → {Promise}

Run a promise with a timeout. If the promise is not fulfilled within the given timeout, the returned promise will be rejected with qui.base.errors.TimeoutError

Parameters:
Name Type Description
promise Promise

the promise to run

timeout Number

the timeout, in milliseconds

Source:
Returns:

the promise with timeout

Type
Promise