-
Notifications
You must be signed in to change notification settings - Fork 322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extract asynchronous I/O layer (e.g. for Celluloid::IO support) #272
Comments
Yea I'd like to work on Socketry but it looks like I'll not have time for a while :( |
I was following #225 but without much familiarity with the history I feel a little short on context from the description of this new ticket—I've swiftly browsed what code exists in the Socketry repo, but since it lacks specs and a high-level README description at this point, would you guys mind expanding a little either there or here on it when you have time? I.e. what is the intended focus/scope of Socketry? From @tarcieri's remarks above it sounds to me something like "uniform interface abstraction layer for Ruby asynchronous I/O", but "Socket wrapper around Ruby" sounds a bit conceptually different from that, so not sure that I understand correctly. Would the idea be that httprb uses the Socketry API, then adapters can be implemented for Socketry to be backed with Celluloid::IO, EventMachine, perhaps Cool.io if someone has a legacy case to support, etc.? |
@ches it'd basically be a wholesale extraction of the current timeout code, which has a synchronous API, but async I/O for implementing timeouts. It would work with core Ruby and Celluloid::IO. It could not work with EventMachine and Cool.io, because they're callback-driven. Right now it is very difficult to implement I/O with timeouts in Ruby without using core The timeout code in this library implements them safely by using Celluloid::IO does something similar using nio4r selectors. |
We've actually went for this gem strictly because of |
@tarcieri do you remember what broke with Celluloid::IO? I thought it was due to the timeout portions, we could just make a Celluloid timeout class for people to use I think. |
Yeah, we'd need a Celluloid::IO timeout backend |
It's pretty easy to do, but I'm probably not going to have time to do it this week. I can take a look next week @msufa. |
Excellent! Thanks for the support and swift response @zanker |
@zanker did you get around to looking at it? I'm currently trying to assess the near-future state of Celluloid Support for this gem. |
I've started working on it. I should have the basic pieces of it relatively soon |
Here's a WIP: socketry/socketry#3 |
Socketry is shaping up now: https://github.com/socketry/socketry It's mostly feature complete at this point. Still a little work to do. I started trying to convert http.rb to use it. Note that it only provides an equivalent of |
Thank you for the work on this. Is there any experimental version yet to try this out? -- If not, can you recommend any high level HTTP library that works inside of Celluloid::IO? Socketry looks great, but presumably it is pure access to the socket rather than an HTTP library. |
You can try the |
I'd like to use this as a master tracking ticket for all feature requests/regressions related to the asynchronous I/O layer/timeout implementation.
I think this is one of the most interesting parts of this gem (thanks @zanker) and the two of us have discussed extracting it into a separate gem:
https://github.com/zanker/socketry
The addition of this feature broke Celluloid::IO support. Once upon a time several people suggested to me Celluloid::IO support was the only interesting feature of this gem. I hope we've proved them wrong!
I would still like to support Celluloid::IO as a timeout backend, but it needs the work to add it to the existing timeout framework.
I am tagging this as a milestone 2.0 option for two options:
The text was updated successfully, but these errors were encountered: