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!