Monks,
What is the current "preferred" way to do RPC calls to a different machine with Perl? Is SOAP still the main option?
A few years ago I was using a hand-rolled method of remote procedure calls. It involved Storable and some http requests. Oh, by the way, it sucked. Lots of AUTOLOAD and fiddling with @INC lead to code that was difficult to debug and maintain.
However, it did mean that code like the following would work whether the modules it used and the methods it called were "local" or "remote":
use My::Module; my $obj = My::Module->new( %args ); foreach my $item ( $obj->foo_items ) { $item->do_it; }# end foreach()
At the time we were using Class::DBI for a database ORM. A "stub" base-class on the "client" machines would handle the requests and responses, allowing us to use the same class names on the "client" machines as we did on the remote machine. This worked out very well, but because of the statelessness of http, we could not use database transactions. We used $Data::Dumper::Deparse semantics to serialize a coderef containing the transaction code, and then execute via eval($str) on the remote server. Again - this worked, but it was difficult to debug and maintain.
I wonder how this might work out a bit better at this time - with Moose now and with Perl6 arriving soon.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Preferred RPC method?
by perrin (Chancellor) on Jun 30, 2009 at 23:02 UTC | |
Re: Preferred RPC method?
by ruoso (Curate) on Jul 01, 2009 at 13:38 UTC | |
Re: Preferred RPC method?
by ambrus (Abbot) on Jun 30, 2009 at 19:39 UTC | |
by afoken (Chancellor) on Jun 30, 2009 at 20:37 UTC | |
Re: Preferred RPC method?
by Rhandom (Curate) on Jul 02, 2009 at 13:52 UTC | |
Re: Preferred RPC method?
by sundialsvc4 (Abbot) on Jul 14, 2009 at 23:45 UTC |