Skip to main content

Video request: using message_bus gem

Gems / Libraries • Asked by TL

Message_bus is a really nice gem by Sam Saffron that powers Discourse and thousands of other sites; it offers a server-to-server channel based notification system (so, as far as I understand, your app can subscribe and notify itself of events, in an asynchronous way) and, the main feature for me, it provides for a real-time way of sending data to the front-end using polling, long-polling or long-polling + streaming, without having to configure Websockets, working out of the box with normal app servers like Puma and without having a huge performance impact.

It's also smart enough to share updates via multiple tabs so they don't all hit your app if you have multiple of them opened.

The gem is really powerfull and simple, but the documentation is lacking, so that's why I think it's a great candidate for a video by GoRails!

It could be used, for instance, to update comments our notifications in real time in the frontend.

I'm imagining a video where MessageBus is used to get updated JSON to the front-end, automatically feeding it into Vue or React!


I've had this on my todo list for a while now and just haven't had the time to explore it properly so I can make a screencast. I'll have to do this soon.


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 27,623+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.