<html><head></head><body bgcolor="#FFFFFF"><div><br><br><br></div><div><br>Le 27 déc. 2013 à 08:40, Celogeek San <<a href="mailto:me@celogeek.com">me@celogeek.com</a>> a écrit :<br><br></div><div></div><blockquote type="cite"><div><p dir="ltr">Hi. What happen in case of read timeout?<br>
Did you close the connexion?</p>
<p dir="ltr">If I read a data with a very long time to response.<br>
So I have a read time out.<br>
And then I do another command.<br>
It is possible if the socket had not been flush to receive the precedent command</p></div></blockquote><div>Yes indeed. Contrary to a previous implementation ( where the socket was closed for you), this implementation doesn't do anything for you on the socket. When a timeout is hit, Redis.pm throws an exception and $! Is set. You should then close the connection and retry. </div><div><br></div><div>In theory, if the timeout was hit while writing, you could retry with the same socket, because you can be reasonably site that the command didn't hit the server. However, I don't think Redis exceptions will make it clear if it was while reading or writing. There is a ticket on github to implement better exceptions. </div><div><br></div><br><blockquote type="cite"><div>
<div class="gmail_quote">Le 26 déc. 2013 23:28, "Damien Krotkine" <<a href="mailto:damien@krotkine.com">damien@krotkine.com</a>> a écrit :<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I've just pushed new code in the git master branch. It contains timeouts<br>
related features. Now you can creates a Redis client with connection,<br>
read and write timeouts:<br>
<br>
my $redis = Redis->new(<br>
cnx_timeout => 60, # connection timeout (in seconds)<br>
read_timeout => 0,5, # read timeout (in seconds)<br>
write_timeout => 1.2, # write timeout (in seconds)<br>
);<br>
<br>
I haven't yet released it on CPAN, I'd like to do a developer release<br>
first (but I'm not sure how to do that with dzil). Anyway please feel<br>
free to test it and let me know of any issues. The code uses 2<br>
strategies, on mac and linux it uses setsockopt to set read / write<br>
timeouts, on other OS it uses 'select'. I plan to extend the setsockopt<br>
strategies to more OS.<br>
<br>
dams.<br>
<br>
<br>
_______________________________________________<br>
Redis mailing list<br>
<a href="mailto:Redis@lists.scsys.co.uk">Redis@lists.scsys.co.uk</a><br>
<a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/redis" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/redis</a><br>
</blockquote></div>
</div></blockquote></body></html>