Ask A Question

Notifications

You’re not receiving notifications from this thread.

Video request: using message_bus gem

TL asked in Gems / Libraries

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!

Reply

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.

Reply

Hi Chris, I know you just revised the series on group chats, but I was wondering if you would do an episode on how you would do something similar with message_bus. I'm looking for something that can be used for creating channels, but might be more scalable in terms of how many users the channels can accommodate concurrently (e.g. thousands of people).

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 85,376+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.