GeneratorSpawnTrySync (open)

This function asynchronously drives a generator function that yields promises. If the async generator doesn't yield or return a promise, the value is returned directly. Otherwise, a promise for the return value is returned.

Syntax

// Core function, no LOADLIB necessary

VARIANT FUNCTION GeneratorSpawnTrySync(OBJECT generator)

Parameters

OBJECT generator

Generator to run synchronously (if possible)

Return value

VARIANT

Generator return value (or promise for that value)