6cfb9bbef1f18c24d3f1760b1bb061dd637d8a83
[scpubgit/Object-Remote.git] / lib / Object / Remote.pm
1 package Object::Remote;
2
3 use Object::Remote::MiniLoop;
4 use Object::Remote::Handle;
5 use Module::Runtime qw(use_module);
6
7 sub new::on {
8   my ($class, $on, @args) = @_;
9   my $conn = use_module('Object::Remote::Connection')->new_from_spec($on);
10   return $conn->new_remote(class => $class, args => \@args);
11 }
12
13 sub new {
14   shift;
15   Object::Remote::Handle->new(@_)->proxy;
16 }
17
18 sub current_loop {
19   our $Current_Loop ||= Object::Remote::MiniLoop->new
20 }
21
22 1;