SplitScript reference / future

future

namespace

Coordinates lazy asynchronous values without exposing threads or background tasks.

Future combinators only make progress when their returned future is polled with await. They preserve the attachment-lifetime cancellation of their inputs.

Examples

Coordinate alternative asynchronous work

await future.race([nextTick(), nextTick()])
print("one tick operation completed")

Functions

MemberDescriptionAvailable through
raceWaits for the first operation that completes.
timeoutWaits for an operation until a duration has elapsed.