has local_objects_by_id => (is => 'ro', default => sub { {} });
-has remote_objects_by_id => (
- is => 'ro', default => sub { { NULL => bless({}, 'Object::Remote::Null') } }
-);
+has remote_objects_by_id => (is => 'ro', default => sub { {} });
has _json => (
is => 'lazy',
JSON::PP->new->filter_json_single_key_object(
__remote_object__ => sub {
my $id = shift;
+ return bless({}, 'Object::Remote::Null') if $id eq 'NULL';
(
$remotes->{$id}
or Object::Remote->new(connection => $self, id => $id)
sub send_discard {
my ($self, $type, @call) = @_;
- unshift @call, $type => { __remote_object => 'NULL' };
+ unshift @call, $type => { __remote_object__ => 'NULL' };
$self->_send(\@call);
}
sub receive_call {
my ($self, $future, $id, @rest) = @_;
+ $future->{method} = 'call_discard';
my $local = $self->local_objects_by_id->{$id}
or do { $future->fail("No such object $id"); return };
$self->_invoke($future, $local, @rest);
sub receive_class_call {
my ($self, $future, $class, @rest) = @_;
+ $future->{method} = 'call_discard';
eval { use_module($class) }
or do { $future->fail("Error loading ${class}: $@"); return };
$self->_invoke($future, $class, @rest);