I'm working on a couple different apps right now. One is new and one I'm refactoring some new functionality into. I'm looking to add messaging between users in both apps.
I'm up in the air on the best way to do this. I was initially thinking about a faye pub/sub setup to allow users to chat, but there's significant technical debt associated with this. My other thought is to use the mailboxer gem to handle messaging then some sort of polling via ajax to notify users of new messages in the nav.
Any thoughts on what's the best route? My goal is 2-way conversations between users, whether it's in realtime or close to realtime.
Campfire, known for being the most popular chat application, was built using polling. You probably don't absolutely need to handle chat in realtime. It did a 3 second poll and updated the chat each time.
That said, Faye is great and so is something like Pusher. I don't know that it really matters either way you go other than going with the one you're more familiar with maintaining for stability reasons.
I've done some research on Pusher but I'm doing my best to keep the 3rd-party API dependencies to a minimum. Although pusher does an excellent job with realtime messaging and events. Then there's also the cost associated with it, which I'm trying to eliminate. It's bad enough that I'm pouring through $100/mo easily with Twilio on both apps.
Maybe you can do an updated screencast on Faye? I've played with it a bit but always got stuck when trying to associate channels and devise users. I'm not totally opposed to the technical debt of having to run more in my stacks, but less is more as always. That's one of the reasons why I was looking at the mailboxer gem to make a model messageable. Seems like a simple drop-in process compared to having to architect a lot of moving parts.
Join 27,623+ developers who get early access to new screencasts, articles, guides, updates, and more.