X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FObject%2FRemote.pm;h=fc6e9557643fae60f0fb00d17a9039ee5161d9f4;hb=a2d43709dfa7abde4741638259cbc7cbfa90108c;hp=6cfb9bbef1f18c24d3f1760b1bb061dd637d8a83;hpb=e144d525c19bc4488952e4cea0ea0fe47a8db133;p=scpubgit%2FObject-Remote.git diff --git a/lib/Object/Remote.pm b/lib/Object/Remote.pm index 6cfb9bb..fc6e955 100644 --- a/lib/Object/Remote.pm +++ b/lib/Object/Remote.pm @@ -6,8 +6,8 @@ use Module::Runtime qw(use_module); sub new::on { my ($class, $on, @args) = @_; - my $conn = use_module('Object::Remote::Connection')->new_from_spec($on); - return $conn->new_remote(class => $class, args => \@args); + my $conn = __PACKAGE__->connect($on); + return $conn->remote_object(class => $class, args => \@args); } sub new { @@ -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 }