From: Eric Wong Date: 2011-11-10T08:00:52+09:00 Subject: [ruby-core:40895] Re: [Ruby 1.9 - Bug #5138][Open] Add nonblocking IO that does not use exceptions for EOF and EWOULDBLOCK Aaron Patterson wrote: > I spoke with matz about this issue at RubyConf. I *think* he said it > was a good feature, but he wanted a different API. I can't remember > exactly. > > Maybe matz can comment? I should also note there is one major API difference between Yehuda's patch and the original kgio API: kgio returns the unwritten portion of the String on a partial write and nil on a full write (meaning there's nothing further to write from that buffer). kgio predates String#byteslice (and still needs to support 1.9.2), so I did the byteslice in C to avoid the overhead of doing it in Rubies without String#byteslice. Yehuda's patch always returns the number of bytes written if anything was written, so his API is more consistent with traditional IO write methods. (Of course, kgio also supports libautocork-like behavior nowadays, but that's a separate issue :>)