EventMachine: Get Excited By Scalable Non-Blocking I/O
EventMachine is a simple(ish), fast, event-driven I/O library for Ruby. Its goal is to provide highly scalable I/O performance with an easy-to-use API wrapped around the nastiest parts of the process (since typical Ruby coding practices aren't particularly event-driven friendly). Aman Gupta has put together an awesome 114-page deck of slides (also available as a PDF) that walks through EventMachine with lots of practical code examples.
The presentation walks through:
- Who uses EventMachine (a lot of big guys - Heroku, GitHub, 37signals, Engine Yard, PostRank)
- What EventMachine is good for
- Ruby's other I/O solutions (and why they suck)
- What a "reactor" is
- How to write asychronous code with EventMachine's API
- How EventMachine provides event-compatible iterators and timers
- EventMachine's message channels
Even though Aman's slides are meant to go alongside a live presentation, they stand well on their own and provide more than enough incentive to check out EventMachine is event-driven I/O is something that would benefit you, so stop reading this post and get flicking through Aman's awesome slides!
March 19, 2010 at 1:03 am
I gave a talk two months ago about using EventMachine with Ruby 1.9 and Fibers to provide asynchronous processing with a more standard Ruby coding style.
The problem with EventMachine and Ruby 1.8 is that it forces the callback style of programming on your entire application (e.g. see Cramp vs Rails).
http://www.mikeperham.com/2010/01/27/scalable-ruby-processing-with-eventmachine/
March 19, 2010 at 4:04 am
A link to your post is added at the Drink Rails blog.
March 19, 2010 at 2:32 pm
PDF link:
Oops! (509)
This account's public links are generating too much traffic and have been temporarily disabled!
March 19, 2010 at 3:12 pm
Damn, the PDF link at scribd is failing on me :-( Anyone has another link?
March 19, 2010 at 3:12 pm
You've killed that dropbox link for the PDF with your post ;-)
March 19, 2010 at 3:13 pm
Ah, forgive me, it was the timetobleed.com link that's failing, the download link within scribd's flash player works fine.
March 19, 2010 at 3:49 pm
Oh man, the only reason I did a direct link was because it was to Dropbox and I assumed they'd "just work" being a big service and all :-) Thanks for the heads up.