ryanb / private_pub

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

Has anyone tried running private_pub with rainbows? #80

Closed arjuntr88 closed 5 years ago

arjuntr88 commented 11 years ago

I tried running with rainbows, browser client continuously kept sending the initial negotiation request. private_pub.ru:

Run with: rackup private_pub.ru -s thin -E production

require "bundler/setup" require "yaml" require "faye" require "private_pub" require "faye/redis"

Faye::WebSocket.load_adapter('rainbows') yml = YAML::load_file("config/private_pub_redis.yml")[ENV["RAILS_ENV"] || "development"] PrivatePub.load_config(File.expand_path("../config/private_pub.yml", FILE), ENV["RAILS_ENV"] || "development") run PrivatePub.faye_app(:timeout => 1, :engine => { :type => Faye::Redis, :host => yml["server"], :port => yml["port"] })

rainbows.conf:

rainbows.conf

Rainbows! do use :EventMachine

end

I run the server using this:

rainbows private_pub.ru -c config/rainbows.conf -E production -p 9292

Am I missing something or configured somthing wrong?

arjuntr88 commented 11 years ago

fixed the issue by removing "use :EventMachine" from rainbows.conf, since its not required from version 4.5.0

Now facing different issue and no idea whats causing it, I'm using the configuration above but without eventmachine in rainbos.conf :

Server error log when the page is loaded on the browser: E, [2013-06-03T22:29:10.673828 #17953] ERROR -- : app error: undefined method call' for nil:NilClass (NoMethodError) E, [2013-06-03T22:29:10.674195 #17953] ERROR -- : /var/lib/gems/1.9.1/gems/faye-websocket-0.4.7/lib/faye/websocket.rb:143:ininitialize' E, [2013-06-03T22:29:10.674343 #17953] ERROR -- : /var/lib/gems/1.9.1/gems/faye-0.8.9/lib/faye/adapters/rack_adapter.rb:131:in new' E, [2013-06-03T22:29:10.674465 #17953] ERROR -- : /var/lib/gems/1.9.1/gems/faye-0.8.9/lib/faye/adapters/rack_adapter.rb:131:inhandle_websocket' E, [2013-06-03T22:29:10.674563 #17953] ERROR -- : /var/lib/gems/1.9.1/gems/faye-0.8.9/lib/faye/adapters/rack_adapter.rb:88:in call' E, [2013-06-03T22:29:10.674642 #17953] ERROR -- : /var/lib/gems/1.9.1/gems/rainbows-4.5.0/lib/rainbows/max_body.rb:66:inblock in call' E, [2013-06-03T22:29:10.674717 #17953] ERROR -- : /var/lib/gems/1.9.1/gems/rainbows-4.5.0/lib/rainbows/max_body.rb:59:in catch' E, [2013-06-03T22:29:10.674790 #17953] ERROR -- : /var/lib/gems/1.9.1/gems/rainbows-4.5.0/lib/rainbows/max_body.rb:59:incall' E, [2013-06-03T22:29:10.674863 #17953] ERROR -- : /var/lib/gems/1.9.1/gems/rainbows-4.5.0/lib/rainbows/process_client.rb:44:in process_loop' E, [2013-06-03T22:29:10.674937 #17953] ERROR -- : /var/lib/gems/1.9.1/gems/rainbows-4.5.0/lib/rainbows/base.rb:32:inprocess_client' E, [2013-06-03T22:29:10.675015 #17953] ERROR -- : /var/lib/gems/1.9.1/gems/unicorn-4.6.2/lib/unicorn/http_server.rb:632:in worker_loop' E, [2013-06-03T22:29:10.675099 #17953] ERROR -- : /var/lib/gems/1.9.1/gems/rainbows-4.5.0/lib/rainbows/http_server.rb:45:inworker_loop' E, [2013-06-03T22:29:10.675172 #17953] ERROR -- : /var/lib/gems/1.9.1/gems/unicorn-4.6.2/lib/unicorn/http_server.rb:500:in spawn_missing_workers' E, [2013-06-03T22:29:10.675243 #17953] ERROR -- : /var/lib/gems/1.9.1/gems/rainbows-4.5.0/lib/rainbows/http_server.rb:61:inspawn_missing_workers' E, [2013-06-03T22:29:10.675315 #17953] ERROR -- : /var/lib/gems/1.9.1/gems/unicorn-4.6.2/lib/unicorn/http_server.rb:142:in start' E, [2013-06-03T22:29:10.675387 #17953] ERROR -- : /var/lib/gems/1.9.1/gems/rainbows-4.5.0/bin/rainbows:127:in<top (required)>' E, [2013-06-03T22:29:10.675458 #17953] ERROR -- : /usr/local/bin/rainbows:23:in load' E, [2013-06-03T22:29:10.675529 #17953] ERROR -- : /usr/local/bin/rainbows:23:in

'

Browser console error log on :

GET http://localhost:9292/faye?message=%5B%7B%22channel%22%3A%22%2Fmeta%2Fhands…3A%5B%22callback-polling%22%5D%2C%22id%22%3A%221%22%7D%5D&jsonp=**jsonp1** 400 (Bad Request) faye.js:1 WebSocket connection to 'ws://localhost:9292/faye' failed: Unexpected response code: 500 http://localhost:8080/ WebSocket connection to 'ws://localhost:9292/faye' failed: WebSocket is closed before the connection is established.