The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Argon::Process

SYNOPSIS

    use Argon::Process;

    my $proc = Argon::Process->new();
    $proc->spawn;

    my $result = $proc->process($msg);

    $proc->kill;

DESCRIPTION

Argon::Process implements external Perl processes (Argon::Workers) in a platform-independent way.

METHODS

new(args => [...])

Creates a new Argon::Process. The process object is then ready to be launched using spawn().

Optional parameter args may be passed to specify command-line arguments to the Perl interpreter.

is_running()

Returns true if the process has been launched as is currently running.

spawn()

Launches the external Perl process and waits for it to connect back. Throws an error if unable to launch the process or if the process itself does not launch correctly. Returns the PID of the newly created process.

process($msg)

Sends an Argon::Message to the process. The message will be processed and the results returned to the caller. This method yields to the loop then returns the resulting Argon::Message received from the child process.

kill([1])

Kills the process and returns once complete. If the optional second parameter is specified, this method will block execution until the process has been reaped. The default behavior is to yield and sleep until the process has been reaped.

AUTHOR

Jeff Ober mailto:jeffober@gmail.com

LICENSE

BSD license