News for hackers. Stuff that matters.
Re:Live Streaming in Rails 4.0 by lobster_johnson on Tuesday July 31, 2012 @07:21AM (#4316649)
Ruby solves the inversion of control with enumerators (not to be confused with Enumerable): http://www.ruby-doc.org/core-1.9.3/Enumerator.html. It's similar to Python's generators and `yield`, letting you write imperative, sequential code that is executed at the behest of a caller. See randomdata's comment (http://news.ycombinator.com/item?id=4314810) above.
Re:Live Streaming in Rails 4.0 by arthurschreiber on Tuesday July 31, 2012 @10:44AM (#4317476)
Yes, but enumerators are (in most cases) implemented with Fibers. So you're going to get hit with at least some performance degradation.
Re:Live Streaming in Rails 4.0 by bascule on Tuesday July 31, 2012 @01:35PM (#4318586)
There's another way to do this: just write to the goddamn socket.