How to implement websocket-based push services through Rails?

I am creating a messaging application such as WhatsApp. My goal is to expose only the REST API via Rails and push notifications for connected clients via websockets. Thus, clients interact with the server only with the REST API. Only the server sends data through websocket. Customers can only receive data from him.

I have currently created an eventmachine server that listens for connections to web connections and Unix domain socket connections. When a client makes a request in the REST API, Rails connects to the Unix domain juice to tell eventmachine which connected client should be notified via websocket.

My concern is how it will behave in production (my server runs Apache Passenger). Therefore, I am looking for some kind of project to solve my problem. I looked at Fay, but I cannot figure out how to get him to send notifications to related clients from an external process (which can be rails when executing a request). Any ideas?

+7
ruby-on-rails websocket ipc faye em-websocket
source share
1 answer

You looked at sync gem , I do something similar, and that’s exactly what I use

https://github.com/chrismccord/sync

They have a really good integration video and example https://github.com/chrismccord/sync_example

and it fully supports Faye and Pusher.

I use Faye for dev and Pusher for production

0
source share

All Articles