Acme-RPC

 view release on metacpan or  search on metacpan

lib/Acme/RPC.pm  view on Meta::CPAN

* Should switch to our own recurse logic from Data::Dumper to support these other things.

* action=dump on anything; in the case of a coderef, find its source on disc or else deparse it

* action=call on coderefs and blessed objects, with an args parameter, or arg1, arg2, arg3, etc, and a method parameter for blessed objs.

* json will croak if a reference contains objects in side it somewhere.  Should handle this gracefully.

* Offer JSON output!  Not just Data::Dumper.  Do this for action=dump, action=call, and the default tree view.

* If Devel::Leak won't give us refs... have to do an Acme::State style crawl from main::, 
  but crawling into each sub and looking at its lexicals with PadWalker.
  Could make for a nice tree view.
  Would also make it easy to filter out the variables that hold refs.

* Maybe this should be called Acme::RPC.

* Actually crawl into code refs when recursing the output!

* Devel pointer is too much work also.  Maybe we should just cache $tree and then
  walk it again when passed an oid.  *sigh*  Magic isn't working for me today.

lib/Acme/RPC.pm  view on Meta::CPAN

=item C<< / >>

(No parameter.)

=item C<< action=dump >>

Gives an index of packages, subroutines, variables in those subroutines, closures in those variables, and so on.

=item C<< output=json >>

Output a JavaScript datastructures (JSON) instead of Perl style L<Data::Dumper> or HTML.
The main index page otherwise prints out HTML (under the assumption that a human will be digging through it)
and other things mostly emit L<Data::Dumper> formatted text.

=item C<< oid=(number) >>

=item C<< path=/path/to/something >>

There are two ways to specify or reference an object:  by it's C<oid> or by the path to navigate to it from the 
main index screen.
JSON and HTML output from the main index screen specifies the oids of each item and the paths can be derived from

lib/Acme/RPC.pm  view on Meta::CPAN

                close $olderr;
                $buf =~ s{(0x[a-f0-9]{6,})}{<a href="?oid=$1">$1</a>}g;

                # $oid =~ m/^0x[0-9a-f]{8,}$/
                # my $ob = Devel::Pointer::deref(hex($oid));
                my $ob = Devel::Pointer::deref($oid);
                my $buf = Data::Dumper::Dumper($ob);
                # $buf =~ s{(0x[a-f0-9]{6,})}{<a href="?oid=$1">$1</a>}g;
                $request->print(qq{<pre>$buf</pre>\n});
* Accepts posts as well, and handle by data type.
  Posts to CODE refs run them with the arguments (attempt to reconstitute object references in the arguments... move to 0x style oids again
  to support this).
  Posts to object references (blessed things) invoke the named method in them (again, reconstituting the args).
  Posts to scalars, arrays, hashes, etc merely replace their data.




( run in 0.227 second using v1.01-cache-2.11-cpan-1dc43b0fbd2 )