Sounds cleaner to just put an optional timeout on Thrift::Socket, and
allow it to be absent for people who don't want timeouts. The wrapper
feels heavy to me -- but also sounds fine if it's considered good
idiomatic practice to do that in Ruby (I'm still a Ruby n00b).

-----Original Message-----
From: Kevin Ballard [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 10, 2008 1:26 PM
To: [email protected]
Subject: Ruby Thrift::Socket timeout?

Bryan Duxbury has requested that Thrift::Socket be given an optional
Timeout argument, which will make it block on select() instead of
read() and raise an error if it hits the timeout. The alternative is to
make a Thrift::TimeoutTransport which wraps a Thrift::Socket and uses
select itself (as Thrift::Socket implements #to_io, so it can be used in
select()).

Does anybody have any opinions as to which approach is better?

-Kevin Ballard

--
Kevin Ballard
[EMAIL PROTECTED]



Reply via email to