On Wed, Nov 23, 2011 at 2:41 PM, Marvin Humphrey <[email protected]> wrote:
> Those confess() calls are placeholders
understood
> * Change every sysread() to read(), and every syswrite() to write().
done
> * Set $socket->autoflush(1);
done
> * Make sure 'Blocking => 0' is commented out.
done
> * Replace the select() loop with a "for" loop, because select() and
> blocking i/o don't mix.
Not sure about this one - my head is still spinning with all those
hashes yer usin' - they are slowly starting to make sense though.
Presumably you're referring to this section in _multi_rpc() which
needs to change?:
my @responses;
my $remaining = $num_shards;
my $select = $select{$$self};
my $sock_map = $sock_map{$$self};
while ($remaining) {
my @ready = $select->can_read;
for my $sock ( @{ $ready[0] } ) {
my $shard_num = $sock_map->{"$sock"};
my $response = $self->_retrieve_response_from_shard($shard_num);
$responses[$shard_num] = $response->{retval};
$remaining--;
}
}
I'll need your help here, purty please :)