Gargantuan parrillada right before a 17 hour flight. Always a great idea.
Posts by Ismael Celis
As well as the southern sky. Also: a smartphone shouldn’t be this good at night photography, what’s going on!
Southern Chile epic as usual.
📢
Haggis Ruby's is in just over a month, in the wonderful city of Glasgow! Get your tickets here: haggisruby.co.uk We're lucky to have an incredible list of speakers from across the community. If you want an idea of what the talks are like, videos from 2024 are here: www.youtube.com/@HaggisRubys...
Great academic debates in this household.
- 6yo: "For something to be alive, it needs to have atoms"
- 7to: "That's not true! For something to be alive, it needs to go to the toilet!"
There's no storage here. Currently the pubsub and message store implementations are in-memory only, but they're simple interfaces and I'll explore durable versions (and/or event-sourced versions). You're free to manage data however you want. Real-time + multi-player + async jobs in one tiny API!
After handling, commands are published to a pubsub interface. Or, you can publish custom events. The current page subscribes to the events it cares about, and sends rendered components back to the browser. Pages are Phlex components. You can re-render the full page, or parts of it.
This is the app. The UI sends commands to the backend. All commands are handled asynchronously (think "background workers", but it's just fibers running alongside the Falcon process). There's no distinction between a "controller" and a "background job". It's all commands.
Ok, a very simple TODO app, real-time and multi-player, in Ruby.
Project Hail Mary was pretty great
Aaand... It's working.
I think I’m nerd-sniping myself into building a CQRS-first, real time, durable execution by default, start-on-a-single-file web framework for Ruby. I kinda already have all the different pieces in different places.
Zero extra effort for update-as-you-type
😊
Ok this is something that I wanted to look into later, but it sort of falls out of the previous pattern for free: query objects that can build UI controls that trigger server-side blocks that update arbitrary bits of the page for all (or some) connected clients.
Making the API a bit terser. For cases where you just want pages to auto-update when something happens you can omit the handler entirely.
example
For the most part, pages can just render themselves (sending a "fat morph" to the browser), but you can use these hooks to render more granular components on the page, too
The result
I finally started exploring APIs for defining server-rendered page objects that react to events and render themselves.
Death just chuck-norrised.
Brotli builds a sliding-window dictionary as it compresses data, so it's especially efficient with long-lived streaming connections.
This means that "fat morphs" are probably fine for most cases. Just stream the entire page back to the client, only the bits that changed will be morphed into the DOM.
Adding Brotli compression to the Ruby Datastar SDK (compresses SSE streams). First naive benchmarks, but the compression ratios are 🤯
My little built-in dashboard for event-sourcing is a Rack app with a bunch of regexes :)
"Cross-stream" projections are very low-ceremony. Here a Screenings projection updates in real time as seats are booked by different sessions. The projection collects events related to movies, showings and seats without any special orchestration.
Cinema-booking demo for stream-less Event Sourcing going well. Helps find APIs and perf. to tweak. Demos are great dog-food!