Open HoneyryderChuck opened 8 years ago
This could probably use some specs...
@tarcieri I didn't want to write any specs before clearing the awful bit of code inside the reactor. I really think it's time someone takes a look at https://github.com/celluloid/celluloid/pull/491 , code could be cleaned up after that.
I didn't want to write any specs before clearing the awful bit of code inside the reactor.
Why? You are trying to reimplement core Ruby behavior which is completely orthogonal to the reactor.
I mentioned specs specifically because your code has obvious bugs in it (timeout = nil
as a parameter to a method invocation)
@tarcieri maybe I expressed myself in a wrong way. Specs will come. This pull request is far from over. The main goal of it (and this should have been stated in the main description) is to add celluloid-io-compatible reimplementations of the io/wait
methods, of which wait_readable and wait_writable are only two. I want to get the specs sorted out, but I wanted to discuss this here, which looks rather ugly because Celluloid.timeout is still a private method. That pull request I linked (which is quite old) not only fixes that, but also provides a Timeout.timeout compatible signature, something that has been hindering proper support for some core network libraries.
Since this is a different topic, we can discuss it there. I'll continue the io/wait
part on this side.
@TiagoCardoso1983 sounds good, I definitely would like to have io/wait
compatibility
@tarcieri FYI https://github.com/ruby/net-telnet/pull/3
@tarcieri missing API was added, whenever you have some time for a review.
…hes the Celluloid IO Socket APIs, excepted for the signature; Added support for timeout parameter, which will bubble down to Celluloid.timeout; falling back to Kernel.select when the io does not define the method (SSLSockets) or when the implementation in the ruby VMs is buggy (TCPServer and UNIXServer#wait_readable/writable are throwing Errno::EINVAL, weird)