async
Futures and the async runtime.
from "async" import ...
Future class
The result of an async call, available later.
Functions
| all | all([arr]): any | Runs every future in arr concurrently and fulfils with an array of their values, in input order, once every one of them fulfils. |
| constructor | instance.constructor() | Constructs a pending Future |
| getState | instance.getState(): string | Returns the lifecycle state: 'pending', 'fulfilled' or 'faulted' |
| getValue | instance.getValue(): any | Returns the settled value (fulfilled or fault value); throws while pending. A pure peek: reading a fault does not acknowledge it (see markHandled) |
| markHandled | instance.markHandled() | Acknowledges a faulted Future so it is not reported as unhandled; does not consume the value (getValue still reads it) |
| race | race([arr]): any | Settles as whichever future in arr settles first, fulfilled or faulted. |
| reject | instance.reject([value]) | Faults a pending Future with value (default null); ignored if already settled |
| resolve | instance.resolve([value]) | Settles a pending Future with value (default null); ignored if already settled |