Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
At least since node.js everyone knows that real time HTTP responses are the next big thing. The secrets of handling incoming requests asynchronously with Ruby is not yet far spread among Rubyists, as the internals needed for such responses are neither specified nor documented and there is a lack of tools. Still, it is possible to use Server-Sent Events, WebSockets and akin with Rack today. This talk will demonstrate the underlying technologies and how to use them in your Ruby application.
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
In this talk titled "Real Time Rack," Konstantin Haase explores the concept of real-time web responses using Rack, a web server interface for Ruby. He begins by acknowledging the support from Engine Yard for sponsoring his attendance at the Rocky Mountain Ruby 2011 event and shares his background, including his work on Sinatra and involvement with the Rack core team. The discussion defines the evolution of web communication, highlighting the shift from traditional page requests (like HTTP) to modern asynchronous methods such as Ajax and Comet. However, he emphasizes a true real-time approach that involves the server pushing data to the client without repeated requests from the client, leveraging technologies like Server-Sent Events (SSE) and WebSockets. Key points include: - **Understanding Rack**: An overview of how Rack operates as a bridge between Ruby and HTTP, outlining the structure of a basic Rack application, which processes requests through a middleware chain. - **Middleware Demonstration**: An example of middleware that modifies the body of a response to uppercase, showcasing how middleware can interact with Rack applications. - **Streaming Responses**: An explanation of how to implement streaming in Rack applications, allowing for real-time data transmission, using a messaging service setup as an example. - **Evented Streaming**: Introducing EventMachine for implementing event loops to manage multiple connections efficiently. This resolves scalability issues observed with non-evented approaches that block threads with each request. - **Async Sinatra**: Discussion of how to enhance Rack applications by using a library that simplifies asynchronous processing without manual signaling. - **Service and Events**: Exploration of a simpler HTTP standard for data streaming compared to WebSockets, focusing on the ease of implementation and automatic reconnections for clients. - **Websockets and HTTP/2**: Brief mention of websockets as a two-way communication method and the upcoming HTTP/2 protocol, which allows multiple simultaneous requests over a single connection. In conclusion, Haase stresses that while WebSockets are powerful, Service and Events provide a more manageable and straightforward alternative for pushing data to clients. His presentation encapsulates the potential of real-time communications in Ruby applications, demonstrating with practical examples how they can be implemented effectively.
Suggest modifications
Cancel