Open willnotwish opened 1 day ago
I don't think it feasible to run a websocker server from a sidekiq worker. It would be better to have a new, separate, web socket server which would replace pubnub.
I am going to try Centrifugo
I have a centrifugo server running locally OK. It was quick and easy to install.
Now I have to figure out how to publish events. I need to configure it server-side (from the Rails app) first.
Although it is convenient to do so, it seems overkill to have to use Pubnub (or similar) as a mechanism to communicate with a websocket in the browser.
The race is run in the background because it could take too long for a regular http request.
Rails has Action Cable, which allows communication with the browser. I don't think this is built in to Rails 4.2, but I have definitely use web sockets in the past (with old versions of Rails) in order to develop a real-time display panel.