The winter holiday season is approaching š. Letās enjoy one of the latest bits of information on real-time technologies from 2023 and prepare for 2024!
News
Action Cable features in development
At the end of the year, the number of feature PRs to Action Cable spiked (compared to previous years, which were pretty quiet). Noticeable contributions (yet-to-be-merged) includeĀ pong supportĀ (to improve half-open connections detection) andĀ broadcast payload compressionĀ for the PostgreSQL adapter (to overcome the 8kb limit).
More PRs are to come in 2024 from Honestly Yours regarding different server implementation support (such as Async). Stay tuned!
Posts
Replacing WebRTC. The long path to useĀ something elseĀ for real-time media.
The article provides an excellent overview of new web technologies to bring next-gen real-time streaming experience and capabilities to browsers, includingĀ WebCodecsĀ andĀ WebTransport. Check it out to learn how we will write real-time applications (not only media-related) in a couple of years.
Weāve been talking about Turbo 8 for a while. Now, when the first betaĀ has been released, you can try it yourself. And Bradās post is a great starting point.Ā
Releases
A companion update for Turbo 8 beta.1 bringing page refreshes support to Rails. (Think twice before addingĀ broadcasts_refreshesĀ to your model: it publishes an update on every change, which you might not want).
Frame of curiosity: Advent of real-time code šļø š
Every December, millions worldwide participate in advent-calendar-driven challenges in anticipation of Christmas (or just for fun). Modern challenges vary from eating chocolate to collecting Lego figures, drinking coffee and tea, and solving programming puzzles. Letās focus on the latter ones.
Advent of CodeĀ is the most prevalent challenge among software engineers (it has already started, but itās never too late to join). However, there are many other coding challenges for you out there. For example, we haveĀ Advent of PrismĀ (a new Ruby parser) in Ruby world.
I asked myself what a version of Advent of Code focused on the real-time web looks like and started sketching possible challenges. Iām unsure if I will ever make it live (maybe next year?), so Iād like to share some of my favorites with you.
Day 1. tail + cURL = real-time logs
You want to share your production server logs in real-time with another developer who has access to a headless Unix machine with only the essential CLI tools. You have access to a production machine and can write a program in the language of your choice. Write a program that accepts a stream of logs via standard input (Unix pipes) and exposes them over HTTP to the outside world so that you can consume them via cURL:
tail -f production.log | ./my-server
curl -N "http://my-server-ip/logs"
Day 2. Rock, Paper, Scissors, Lizard, Spock
Implement a terminal, HTTP-drivenĀ Rock, Paper, Scissors, Lizard, SpockĀ game. Players issue HTTP requests with the same game ID and their choice to the real-time game server, and as soon as both players send their requests, the server responds to both with the result:
Keep in mind that there could be multiple concurrent games.
Day 3. ABC duel
Letās build a 2-player real-time game called āABC Duelā. Players open a page and press āStartā, as soon as both players enter the room (there could be multiple rooms), the server starts showing letter sequences on the screen. The first player to type the sequence correctly wins the round. There are 9 rounds in total.
Use WebSockets for client-server communication (in both directions) to minimize the latency.
...
Day 10. Dance in sync
Build a collaborative music listening application prototype. One user is a DJ (can pause/resume/seek audio), and others are listeners. Audio is synchronized for everyoneā¦
ā¦ and so on.
P.S.Ā Please let me know if you would like to take part in such a challenge next year and share your ideas!