ryanb / private_pub

Handle pub/sub messaging through private channels in Rails using Faye.
MIT License
864 stars 228 forks source link

Private pub on heroku with 2 or more dynos #52

Open Javierchik opened 12 years ago

Javierchik commented 12 years ago

Hi all!

This gem was working like a champion but when i increased to 2 dynos in heroku it just stop working. Seems that request are processed by both dynos, and dynos are on different machines so somehow i get this JS error at the browser: Unexpected response code:400.

What can i do?

Thanks.

bbarton commented 12 years ago

Hi Javier,

Have you resolved this issue? I'm considering using Private Pub on Heroku but won't if there's no good solution to this problem.

Javierchik commented 12 years ago

Hi @bbarton, i haven't found a solution. :s

alfredo777 commented 12 years ago

Hi, I have a problem when I run my private pub collapses Heroku application in my local server works perfectly with any recommendations or installation of the system needs to work?

d0minikk commented 12 years ago

"Unexpected response code:400." i get the same... but i have two heroku apps - rails app and faye server

Javierchik commented 12 years ago

Hi Guys

I just moved to Pusher. It's very similar but paid and works everywhere, no need redistogo.

C ya.

danneu commented 11 years ago

Without knowing anything about Private Pub gem and listening to these symptoms, make sure your Faye server is running in its own process. That means it'll sit on its own dyno. Then, no matter how many dynos your Rails app ("web" process) is running, they all just talk to the same Faye dyno. You do that by giving it its own entry in the Procfile and then scaling it to 1 dyno.

faye: bundle exec thin -p 8081 etc. etc.

Sounds like you're running Faye on the Rails dyno, so upping the number of Rails server dynos is causing a new Faye server to boot.

Just my guess from reading the issue.

bastiaanterhorst commented 11 years ago

has anyone found out what was causing this? I'm getting it now on a Faye server running on Heroku (no redis, but it's a pure node.js faye server on a single dyno).