Distributed::Process::BaseWorker - base class for all workers, both local and


Distributed-Process documentation Contained in the Distributed-Process distribution.

Index


Code Index:

NAME

Top

Distributed::Process::BaseWorker - base class for all workers, both local and remote

SYNOPSIS

Top

DESCRIPTION

Top

Methods

None of these methods is actually implemented in this base class. They're all implemented either in Distributed::Process::LocalWorker, or in Distributed::Process::RemoteWorker.

Methods in Distributed::Process::LocalWorker will usually simply send a command to their RemoteWorker counterpart, asking it to perform some action on the server side.

Methods in Distributed::Process::RemoteWorker will perform the actions requested by the clients and possibly give a reply back.

synchro TOKEN

Waits for all the connected clients to reach this synchronisation point. TOKEN is an identifier, used to identify which synchronisation point is being reached.

run

This must must be overloaded in subclasses to actually implement the task that is to be run remotely.

delay TOKEN

Just like synchro(), waits for all the connected clients to reach this point. But each client will be notified after a configurable amount of time. This allows the server to let the clients proceed within an interval from each other. See Distributed::Process::Master for details.

time NAME, LIST

Runs the method NAME with the given LIST of arguments and reports the time it took by means of the result() method.

reset_result

Flushes the results from memory. This should be called between two calls to run() so that the results from the second run are not appended to those of the first.

result STRING
result

When called with an argument, adds the STRING to the queue of messages to send back to the server.

When called without arguments, returns the list of queued messages.

SEE ALSO

Top

Distributed::Process::LocalWorker, Distributed::Process::MasterWorker, Distributed::Process::RemoteWorker, Distributed::Process::Worker.

AUTHOR

Top

Cédric Bouvier, <cbouvi@cpan.org>

BUGS

Top

Please report any bugs or feature requests to bug-distributed-process@rt.cpan.org, or through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

COPYRIGHT & LICENSE

Top


Distributed-Process documentation Contained in the Distributed-Process distribution.
package Distributed::Process::BaseWorker;

use warnings;
use strict;

use Distributed::Process;
our @ISA = qw/ Distributed::Process /;

sub synchro {}

sub run {}

sub delay {}

sub time {

    my $self = shift;
    my $method = shift;

    $self->$method(@_);
}

sub reset_result {}

sub result {}

1; # End of Distributed::Process::BaseWorker