X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FObject-Remote.git;a=blobdiff_plain;f=lib%2FObject%2FRemote.pm;h=8894cc7588e3bb67fa50e6ee4734c3297c109c71;hp=6cfb9bbef1f18c24d3f1760b1bb061dd637d8a83;hb=4c17fea55a562db315a029e6bd67b7dbb028a8e9;hpb=c6fe6fbd88a05e860ecdc8942cb86940915172ed diff --git a/lib/Object/Remote.pm b/lib/Object/Remote.pm index 6cfb9bb..8894cc7 100644 --- a/lib/Object/Remote.pm +++ b/lib/Object/Remote.pm @@ -6,7 +6,7 @@ use Module::Runtime qw(use_module); sub new::on { my ($class, $on, @args) = @_; - my $conn = use_module('Object::Remote::Connection')->new_from_spec($on); + my $conn = __PACKAGE__->connect($on); return $conn->new_remote(class => $class, args => \@args); } @@ -15,6 +15,11 @@ sub new { Object::Remote::Handle->new(@_)->proxy; } +sub connect { + my ($class, $to) = @_; + use_module('Object::Remote::Connection')->new_from_spec($to); +} + sub current_loop { our $Current_Loop ||= Object::Remote::MiniLoop->new }