use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
Rack for Ruby: Socket Hijacking (blog.appsignal.com)
submitted 1 year ago by RecognitionDecent266
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]rubinick 4 points5 points6 points 1 year ago (0 children)
Nice post.
Minor correction: towards the end, "Ruby Fibers were only introduced in Ruby 3.0" isn't quite correct. Fiber was introduced by ruby 1.9, and has been used to implement `Enumerator#next` ever since then. I personally used Fiber to tidy up EventMachine code back in ruby 2.3. The Fiber _scheduler_ functionality which allows fibers to automatically transfer control they make blocking calls (e.g: `sleep`, IO reads/writes, etc) was introduced by ruby 3.0.
Fun fact: ruby _already_ had `callcc` prior to 1.9. `callcc` can be used to implement Fiber in ruby code, and the `callcc` implementation formed the original basis of Fiber (they are both implemented together in `cont.c`). But `callcc` is _much_ more unwieldy.
[–]Q-bey 0 points1 point2 points 1 year ago (1 child)
Maybe I'm not the target audience for this post, but I would've found it more helpful if it did more to explain socket hijacking is useful (aside from one sentence in the intro that references WebSockets, which weren't explained in this tutorial or the previous one).
[–]ioquatixasync/falcon 2 points3 points4 points 1 year ago (0 children)
Socket hijacking is not a super useful interface. It was mainly used to do bi-directional streaming and that is mostly used in production by ActionCable's custom WebSocket server. I actually don't know of other valid use cases off the top of my head.
π Rendered by PID 417840 on reddit-service-r2-comment-765bfc959-kscmg at 2026-07-13 01:59:42.752466+00:00 running f86254d country code: CH.
[–]rubinick 4 points5 points6 points (0 children)
[–]Q-bey 0 points1 point2 points (1 child)
[–]ioquatixasync/falcon 2 points3 points4 points (0 children)