module build.util.cmdgroup

Code for launching multiple processes and keeping track of them.

Code Map

//! Code for launching multiple processes and keeping track of them.
module build.util.cmdgroup;


//! Helper class to launch one or more processes to run along side the main
//! process.
class CmdGroup
{
public:
	alias DoneDg = void delegate(i32);


public:
	this(env: Environment, maxWaiting: u32) { }
	fn run(cmd: string, args: string[], dgt: DoneDg, log: FILE*) { }
	fn run(cmd: string, args: string[], dgt: DoneDg, outLog: FILE*, errLog: FILE*) { }
	fn waitOne() { }
	fn waitAll() { }
}

//! Exception form and when execquting commands.
class CmdException : Exception
{
public:
	this(cmd: string, reason: string) { }
	this(cmd: string, args: string[], reason: string) { }
	this(cmd: string, result: i32) { }
	this(cmd: string, args: string[], result: i32) { }
}
class CmdGroup

Helper class to launch one or more processes to run along side the main process.

env: Environment

Environment to launch all processes in.

maxWaiting: u32

Number of simultanious jobs.

waiting: u32

Number of running jobs at this moment.

class Cmd

Small container representing a executed command, is recycled.

cmd: string

Executable.

args: string[]

Arguments to be passed.

done: DoneDg

Called when command has completed.

handle: Pid.OsHandle

System specific process handle.

used: bool

In use.

fn set(cmd: string, args: string[], dgt: DoneDg, handle: Pid.OsHandle)

Initialize all the fields.

fn reset()

Reset to a unused state.

class CmdException : Exception

Exception form and when execquting commands.