From: Matt S Trout Date: Mon, 18 Jun 2012 01:07:34 +0000 (+0100) Subject: actually switch and delete old receive_class_call code X-Git-Tag: v0.001001~15 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f76118668ba9e73a0a66517d9ce5f6f8b291431f;p=scpubgit%2FObject-Remote.git actually switch and delete old receive_class_call code --- diff --git a/lib/Object/Remote/Connection.pm b/lib/Object/Remote/Connection.pm index 5a2f524..bb47fd0 100644 --- a/lib/Object/Remote/Connection.pm +++ b/lib/Object/Remote/Connection.pm @@ -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::/) { diff --git a/lib/Object/Remote/Handle.pm b/lib/Object/Remote/Handle.pm index cc0d4ff..4fac320 100644 --- a/lib/Object/Remote/Handle.pm +++ b/lib/Object/Remote/Handle.pm @@ -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