WaitUntil (open)

Wait until a handle is signalled, a promise is fulfilled or a timeout is reached

Syntax

// Core function, no LOADLIB necessary

RECORD ARRAY FUNCTION WaitUntil(RECORD waitfor, DATETIME until)

Parameters

RECORD waitfor

What to wait for

BOOLEAN callbacks

if TRUE, return when a callback has been executed

BOOLEAN multiple

if TRUE, allow returning multiple results

BOOLEAN nothrow

If TRUE, rejected promises are returned in the return value, instead of throwing the exception.

OBJECT ARRAY promise

Return when any of these promises are fulfilled. Throws when a promise is rejected, returns the fulfilled promise and the value it resolved to otherwise. (optional)

INTEGER ARRAY read

Return when any of these handles is read-signalled (optional)

INTEGER ARRAY write

Return when any of these handles is write-signalled (optional)

DATETIME until

Wait until this time

Return value

RECORD ARRAY

List of signalled items

fulfillmenttype

Indicates whether the promise was resolved or rejected. Values: "resolved" / "rejected" (promise only)

handle

Signalled handle

promise

Fulfilled promise (promises only)

type

Reason of exit: 'handle-read', 'handle-write', 'promise', 'timeout', 'callback')

value

Value the promise resolved to (promises only)