diff --git a/connector/perl/lib/MR/IProto.pm b/connector/perl/lib/MR/IProto.pm index c48c7e698568870912682aaa563f49204a98eafd..27b0e6359bded860e4e2e0c3e477fbd8c0d3538a 100644 --- a/connector/perl/lib/MR/IProto.pm +++ b/connector/perl/lib/MR/IProto.pm @@ -232,13 +232,13 @@ sub send { local $SIG{__DIE__} = sub { local $! = 0; $olddie->(@_); } if $olddie; my %servers; my ($data, $error, $errno); - my $fh = $self->_send_now($message, sub { + my $conn = $self->_send_now($message, sub { ($data, $error) = @_; $errno = $!; return; }, \%servers); - return if $message->{continue} && !$fh; + return if $message->{continue} && !$conn; my $cont = sub { $self->_recv_now(\%servers, max => $message->{continue}?1:0); @@ -249,8 +249,9 @@ sub send { }; return { - fh => $fh, - continue => $cont, + fh => $conn->fh, + connection => $conn, + continue => $cont, } if $message->{continue}; return &$cont(); @@ -553,7 +554,7 @@ sub _send_try { my $connection = $server->$xsync(); return unless $connection->send($args->{msg}, $args->{body}, $handler, $args->{no_reply}, $args->{sync}); $sync->{$connection} ||= $connection if $sync; - return $connection->fh; + return $connection; } sub _send_retry { diff --git a/connector/perl/lib/MR/IProto/Connection/Async.pm b/connector/perl/lib/MR/IProto/Connection/Async.pm index 2fb32bc023636bc21d59a8c920f0005c74077d4f..2fbdb77c0c7c867dfb4350f3dad77d85bcfbf139 100644 --- a/connector/perl/lib/MR/IProto/Connection/Async.pm +++ b/connector/perl/lib/MR/IProto/Connection/Async.pm @@ -269,6 +269,8 @@ around _choose_sync => sub { die "Can't choose sync value after 50 iterations"; }; +sub Close { die "This is not what should be done" } + =back =head1 SEE ALSO diff --git a/connector/perl/lib/MR/IProto/Connection/Sync.pm b/connector/perl/lib/MR/IProto/Connection/Sync.pm index 0331937094aa69e161dc8a501b20e1ced8be2eaf..a838774b4fdc72c9f2e30547ca62746534f5ef2a 100644 --- a/connector/perl/lib/MR/IProto/Connection/Sync.pm +++ b/connector/perl/lib/MR/IProto/Connection/Sync.pm @@ -45,6 +45,15 @@ See L<MR::IProto::Connection/send> for more information. sub fh { return $_[0]->_has_socket && $_[0]->_socket } +sub Close { + my ($self, $reason) = @_; + my $sent = $self->_sent; + while (my $args = shift @$sent) { + my ($sync, $callback) = @$args; + $self->_handle_error($sync, $callback, $reason); + } +} + sub send { my ($self, $msg, $payload, $callback, $no_reply, $sync) = @_; my $server = $self->server; diff --git a/connector/perl/lib/MR/Tarantool/Box.pm b/connector/perl/lib/MR/Tarantool/Box.pm index f60599359955dec257184bbce8854c7e06a51083..03019eed3f045779f415cf4f621a17f8b8b728db 100644 --- a/connector/perl/lib/MR/Tarantool/Box.pm +++ b/connector/perl/lib/MR/Tarantool/Box.pm @@ -79,7 +79,7 @@ use constant { sub IPROTOCLASS () { 'MR::IProto' } use vars qw/$VERSION %ERRORS/; -$VERSION = 0.0.15; +$VERSION = 0.0.16; BEGIN { *confess = \&MR::IProto::confess }