X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FObject%2FRemote.pm;h=cd3a36489ba39a5f205c8222f69e8cf495c88be0;hb=b63a955fda065430b5e0e2c37b07ba292ecc7e28;hp=326a3a580034389fe1f7f8ae6184372e3f4f90ec;hpb=9e72f0cf54e92bccdba71eb75037f1cfe4f69f36;p=scpubgit%2FObject-Remote.git diff --git a/lib/Object/Remote.pm b/lib/Object/Remote.pm index 326a3a5..cd3a364 100644 --- a/lib/Object/Remote.pm +++ b/lib/Object/Remote.pm @@ -9,10 +9,8 @@ has connection => (is => 'ro', required => 1); has id => (is => 'rwp'); -has proxy => (is => 'lazy', weak_ref => 1); - -sub _build_proxy { - bless({ handle => $_[0] }, 'Object::Remote::Proxy'); +sub proxy { + bless({ remote => $_[0], method => 'call' }, 'Object::Remote::Proxy'); } sub BUILD { @@ -36,10 +34,15 @@ sub current_loop { } sub call { - my ($self, $id, $method, @args) = @_; + my ($self, $method, @args) = @_; $self->_await($self->connection->send(call => $self->id, $method, @args)); } +sub call_discard { + my ($self, $method, @args) = @_; + $self->connection->send_discard(call => $self->id, $method, @args); +} + sub _await { my ($self, $future) = @_; my $loop = $self->current_loop;