All threads / Can you use Actioncable for multiple things in your project?

Ask A Question

Notifications

You’re not receiving notifications from this thread.

Can you use Actioncable for multiple things in your project?

Masud Hossain asked in Rails

I want to use actioncable to pull notifications AND also use it for user to user chatting. Is this possible and pain free to do?

I guess what i'm asking is, can i join these two videos together into one project without doing anything special:

https://gorails.com/episodes/realtime-notifications-with-actioncable?autoplay=1
https://gorails.com/episodes/direct-messages-in-realtime-with-actioncable?autoplay=1

Hey Masud,

Absolutely. The way it's designed is that you can create a new channel for each feature you want and the ActionCable code internally will automatically separate out the messages for each of those channels. That means you can have one for notifications and one for chat and they will be separated out between those channels.

Join the discussion

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

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

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

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.