CallSerializer::Wrap (open)
Wrap a function pointer, returns a proxy that will ensure the function will be called in a serialized manner.
Syntax
LOADLIB "wh::async.whlib";
FUNCTION PTR FUNCTION Wrap(FUNCTION PTR func, RECORD options)Parameters
FUNCTION PTR funcFunction to wrap
RECORD optionsOptions
coalescetagIf not empty, coalesce multiple pending calls to one call (if a call is running, a new call is still scheduled). If not empty, the returned function does not take any parameters (unless ignoreparameters is set)
ignoreparametersIf set, ignore parameters passed to the returned function, and call the passed function without any parameters.
Return value
FUNCTION PTRA function pointer that when called will first wait for a execution slot to become available, will call the wrapped function ptr, and return its result.