MakeProcessAsyncIterator

Returns a async iterator which yields lines of output

Syntax

LOADLIB "wh::os.whlib";

ASYNC FUNCTION * MakeProcessAsyncIterator(OBJECT process, RECORD options)

Parameters

OBJECT process

Process

RECORD options

Options

autoclose

If TRUE, automatically close the process when the iterator terminates. Defaults to TRUE.

Return value

Async iterator. Yields the following values

  • [ type := "output", line := line ]
  • [ type := "error", line := line ]
  • [ type := "close", exitcode := exitcode ]