actually switch and delete old receive_class_call code
Matt S Trout [Mon, 18 Jun 2012 01:07:34 +0000 (02:07 +0100)]
lib/Object/Remote/Connection.pm
lib/Object/Remote/Handle.pm

index 5a2f524..bb47fd0 100644 (file)
@@ -294,15 +294,6 @@ sub receive_call_free {
   $self->receive_free($id);
 }
 
-sub receive_class_call {
-  my ($self, $future_id, $class, @rest) = @_;
-  my $future = $self->_id_to_remote_object($future_id);
-  $future->{method} = 'call_discard_free';
-  eval { use_module($class) }
-    or do { $future->fail("Error loading ${class}: $@"); return };
-  $self->_invoke($future, $class, @rest);
-}
-
 sub _invoke {
   my ($self, $future, $local, $ctx, $method, @args) = @_;
   if ($method =~ /^start::/) {
index cc0d4ff..4fac320 100644 (file)
@@ -34,8 +34,8 @@ sub BUILD {
     ref($_) eq 'HASH' and $_ = [ %$_ ] for $args->{args};
     $self->_set_id(
       await_future(
-        $self->connection->send(
-          class_call => $args->{class}, 0,
+        $self->connection->send_class_call(
+          0, $args->{class},
           $args->{constructor}||'new', @{$args->{args}||[]}
         )
       )->{remote}->disarm_free->id