Le jeudi 10 mars 2005, à 12 heures 16, David Landgren écrivait :
> Distributed, yes, but Distributed::Simple, no. In general I dislike 
> modules named *::Simple. Because they never are. And doubly more so if 
> it's not actually simplifying what another module, e.g. 
> Distributed::Complicated::Horribly, already does, since there is no 
> other module for the moment.

I do agree with you (except on *::Simple never being simple, but that's
another story for another thread). I'll leave Distributed::Simple for
later, after something more complicated had been published.

> What about something like Distributed::Server and Distributed::Client, 
> and bundling them up into a Bundle::Distributed? or Distributed-tools. 
> Again, posting the Synopsis would help.

The way I designed it, both the server and the client derive from the
same code. So I'd rather keep it one distribution. Furthermore, if
someone else someday codes another framework for distributing the
execution of code, he might want to call it Distributed::Server and
Client as well, so I'd rather not take the whole place at the top level:
Distributed::SomethingShort, but not just Distributed.

As for the synopsis, as I said earlier, I have hardly begun documenting
my code. So I couldn't post it any earlier. Here's a first draft
(remember the original name is Test::Distributed, but this is what I
want to change):

    First, write a subclass of Test::Distributed::Tester that will
    implement the tasks to be run remotely in its run() method.

        package MyTester;
        use Test::Distributed;
        use Test::Distributed::Tester;
        our @ISA = qw/ Test::Distributed::Tester /;

        sub __task {
            my $self = shift;
            # do something useful
            $self->result('report on what happened');
        }

        sub run {
            my $self = shift;
            $self->__task();
        }

    All methods whose name starts with a double underscore will be run
    on the remote machines (the Clients).

    Write a small server that uses this C<MyTester> class.

        # Server
        use Test::Distributed;
        use Test::Distributed::Server;
        use Test::Distributed::Master;
        use MyTester;

        $master = new Test::Distributed::Master -tester_class => 'MyTester',
            -in_handle => \*STDIN, -out_handle => \*STDOUT,
            -n_testers => 2;
        $server = new Test::Distributed::Server -port => 8147, -master => 
$master;

        $server->listen();

    Write a small client as well and install it on all the client
    machines:

        # Client
        use Test::Distributed;
        use Test::Distributed::Client;
        use MyTester;

        $client = new Test::Distributed::Client -test_class => 'MyTester',
            -host => 'the-server', -port => 8147;
        $client->run();

    The server will locally run the MyTester::run() method, but the call
    to __task() will be transformed into a query sent to the clients.
    When receiving this query, the clients will run the real __task()
    method, and send its results back at the server, who will print them
    to standard output.

Thank you *a lot* for your interest and active cooperation.

-- 
C é d r i c   B o u v i e r

Reply via email to