IDLAsyncSpawnJob

IDLAsyncSpawnJob

The IDLAsyncSpawnJob class represents a unit of work to be done at some point in the future by spawning an external process to perform the work. On creation, specify the scalar string to be passed into that process via STDIN. After the job is complete, you can retrieve the contents of the process's STDOUT output. Submitting these to an IDLAsyncQueue will allow them to be performed as resources become available.

Syntax

Arguments

Exec

Specify a scalar string for the external application to spawn. Standard use of the PATH environment variable and current working directory will apply if this is a relative path. This string can contain command line arguments if needed.

The STDERR keyword is not set when calling SPAWN, so output on STDERR will not be captured unless you make that part of this command string. You can redirect STDERR to a file or multiplex it into stdout as needed.

Note: On Windows the /NOSHELL keyword is set in the call to SPAWN, to ensure that standard redirection syntax can be used.

Note: On Unix the /SH keyword is set in the call to SPAWN, to ensure the Bourne shell is used and standard redirection syntax can be used.

Keywords

JOIN (optional)

Specify an IDLAsyncJoin object that is passed to the IDLAsyncJob base class Init() method for handling.

STDIN (optional)

Specify a scalar string that will be sent to the external application via STDIN.

WAIT (optional)

Specify the amount of time in seconds to wait between polling the external process for output or completion. If this is not set, then the default value is 0.1 seconds.

Methods

Properties

IDLAsyncSpawnJob inherits all properties from IDLAsyncJob. The IDLAsyncSpawnJob properties below are Get-only.

COMMAND

The external process to spawn when this job is run. This was the Exec argument used in constructing this job.

EXIT_STATUS

The exit code of the spawned external process when it terminates.

PID

The process ID of the spawned external process.

STDOUT

A List containing all the lines of text the spawned external process wrote to STDOUT.

IDLAsyncSpawnJob::GetReturnValue

The IDLAsyncSpawnJob::GetReturnValue method is an override of the IDLAsyncJob interface method. The only variable that can be retrieved is STDOUT, which is a List containing all the string output read from the STDOUT pipe connected to the external process.

Note: This will only contain information from STDERR multiplexed into STDOUT if that redirection is specified in the COMMAND property.

Syntax

IDLAsyncSpawnJob.GetReturnValue, STDOUT=list

Arguments

None

Keywords

STDOUT

The contents read from STDOUT from the external application. This is stored as a list of strings, to allow users to insert carriage returns between lines as needed.

IDLAsyncSpawnJob::OnDone

The IDLAsyncSpawnJob::OnDone method is an implementation override of the IDLAsyncJob callback invoked on this job by the Done event handler. This will ensure the LUN returned in the UNIT keyword of Spawn will be freed.

Syntax

IDLAsyncSpawnJob.OnDone

Arguments

None

Keywords

None

IDLAsyncSpawnJob::OnStart

The IDLAsyncSpawnJob::OnStart method is an implementation override of the IDLAsyncJob callback invoked on this job by the Start event handler. The basic sequence of operations is: