add Object::Remote->connect
[scpubgit/Object-Remote.git] / lib / Object / Remote / Connection.pm
index a5ad302..f466452 100644 (file)
@@ -106,6 +106,19 @@ sub new_remote {
   )->proxy;
 }
 
+sub connect {
+  my ($self, $to) = @_;
+  return await_future($self->send(
+    class_call => 'Object::Remote', 0, connect => $to
+  ));
+}
+
+sub get_remote_sub {
+  my ($self, $sub) = @_;
+  my ($pkg, $name) = $sub =~ m/^(.*)::([^:]+)$/;
+  return await_future($self->send(class_call => $pkg, 0, can => $name));
+}
+
 sub register_remote {
   my ($self, $remote) = @_;
   weaken($self->remote_objects_by_id->{$remote->id} = $remote);