Wrapping Up

In this chapter, we used Rails live-streaming functionalities to push server-sent events to the browser. Our implementation had a central entity listening for filesystem changes, which were pushed to a group of subscribers. We used Ruby’s built-in threads and queues to control the information flow throughout our system.

The topics discussed in this chapter are a basis to introduce code-loading techniques in Rails, and how those techniques affect the deployment of our applications. We glanced over thread safety and the subtleties involved with different web servers and Ruby implementations.

Next let’s see how to encapsulate our controllers’ behavior in an object called ActionController::Responder and customize it to suit our ...

Get Crafting Rails 4 Applications, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.