Heh, actually, most of the recent ruby lib rewriting was my work. But
it's hard to make it more idiomatic without actually breaking existing
code, and that was something we decided we didn't want to do.
-Kevin
On Jul 10, 2008, at 2:14 PM, Mark Slee wrote:
I wouldn't consider it good idiomatic ruby, but the Thrift libs
aren't structured as good idiomatic ruby.
Yeah... sorry about that. I "learned" Ruby by porting the Python. You
should really feel quite free to overhaul the Ruby stuff and make it
better and more idiomatic (Kevin Clark's already led the way, doing
quite a bit of that).
-----Original Message-----
From: Kevin Ballard [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 10, 2008 2:06 PM
To: [email protected]
Subject: Re: Ruby Thrift::Socket timeout?
I wouldn't consider it good idiomatic ruby, but the Thrift libs aren't
structured as good idiomatic ruby. My only reason for suggesting the
Thrift::TimeoutTransport is so it could work with other transports
that
implement #to_io, but I'm perfectly happy just giving Thrift::Socket
the
optional argument.
-Kevin Ballard
On Jul 10, 2008, at 1:45 PM, Mark Slee wrote:
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]
--
Kevin Ballard
[EMAIL PROTECTED]
--
Kevin Ballard
[EMAIL PROTECTED]