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