WaitForPromise (open)

Synchronously waits for a promise to resolve

Syntax

// Core function, no LOADLIB necessary

VARIANT FUNCTION WaitForPromise(OBJECT promise, RECORD options)

Parameters

OBJECT promise

Promise to wait for

RECORD options

Options

DATETIME timeout

Timeout

timeoutvalue

Value to return in case of timeout (the function will throws if this is not provided)

Return value

VARIANT

Return value of the promise if resolved (or an exception if rejected)