MakeProcessAsyncIterator (open)

Returns a async iterator which yields lines of output from a process

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", data := line ]
  • [ type := "error", data := line ]
  • [ type := "close", exitcode := exitcode ]