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

NAME

Argon::Simple

SYNOPSIS

    use Argon::Simple;

    connect 'somehost:9999';

    my $deferred = process { shift * 2 } 21;
    if ($deferred->() == 42) {
        print "So long, and thanks for all the fish!\n";
    }

    my ($deferred, $is_finished) = process { shift * 2 } 21;
    do { print "." } until $is_finished->();
    print "So long, and thanks for all the fish!\n";

DESCRIPTION

In most cases, a script or application is going to connect to a single Argon system. For these cases, this module provides simplified access to the Argon system.

SUBROUTINES

connect("host:port")

Connects to a single Argon manager. If called with a single argument, a string in the form of "host:port" is expected. Alternately, the host and port may be passed as two separate arguments (e.g. connect($host, $port)).

process { code } @args

When called in scalar context, returns a CODE reference. When called, the Coro thread will block (cede) until the result is retrieved from the Argon system and is available.

When called in list context, additionally returns a CODE reference which evaluates to true when the task has been completed by the Argon system.

AUTHOR

Jeff Ober <jeffober@gmail.com>