Argon::Simple
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";
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.
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)).
connect($host, $port)
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.
Coro
When called in list context, additionally returns a CODE reference which evaluates to true when the task has been completed by the Argon system.
Jeff Ober <jeffober@gmail.com>
To install Argon, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Argon
CPAN shell
perl -MCPAN -e shell install Argon
For more information on module installation, please visit the detailed CPAN module installation guide.