Argon::Client
use Argon::Client; my $client = Argon::Client->new(port => 8000, host => 'some.host.name'); $client->connect; my $result = $client->process( class => 'Some::Class', # with Argon::Role::Task params => [ foo => 'bar', baz => 'bat' ], );
Argon::Client provides a client connection to an Argon::Node or Argon::Cluster instance and a simple API for sending tasks and retrieving the results.
Creates a new Argon::Client that will connect to host:port. Port must be a valid port number and host a valid hostname to which the current system can connect.
Creates a connection to the remote host. An error is thrown if the connection fails.
Queues a task on the remote host and returns the results. If the task resulted in an error, it is rethrown here. Otherwise, the result of calling the run method of the class passed as an argument. Params expects an array ref of arguments to be passed to class's constructor (although they may be in the form of hash arguments, e.g. [foo = 'bar']>).
[foo =
By default, tasks are sent with a priority of PRI_NORMAL. This may be controlled via the priority parameter.
PRI_NORMAL
Due to Argon's architecture, an overloaded system will reject tasks rather than create a large backlog. When this happens, Argon::Client silently retries the task indefinitely until it is accepted and completed. To control this behavior, the optional parameter retries may be specified to limit the number of retries.
Jeff Ober mailto:jeffober@gmail.com
BSD license
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.