factor handle code out so Object::Remote->new returns a proxy
[scpubgit/Object-Remote.git] / lib / Object / Remote.pm
1 package Object::Remote;
2
3 use Object::Remote::MiniLoop;
4 use Object::Remote::Handle;
5
6 sub new::on {
7   my ($class, $on, @args) = @_;
8   Object::Remote::Handle->new(
9     connection => $on,
10     class => $class,
11     args => \@args
12   )->proxy;
13 }
14
15 sub new {
16   shift;
17   Object::Remote::Handle->new(@_)->proxy;
18 }
19
20 sub current_loop {
21   our $Current_Loop ||= Object::Remote::MiniLoop->new
22 }
23
24 1;