How do you spawn an EventMachine “inside” a Rails app?

前端 未结 8 2056
星月不相逢
星月不相逢 2020-12-13 14:54

I\'ve got a Rails application, and am looking to add some sort of WebSocket support to it. From various googling, it appears that the best Ruby based WebSocket solution is

8条回答
  •  [愿得一人]
    2020-12-13 15:38

    I spent a considerable amount of time looking into this. EventMachine need to run as a thread in your rails install (unless you are using Thin,) and there are some special considerations for Passenger. I wrote our implementation up here: http://www.hiringthing.com/2011/11/04/eventmachine-with-rails.html

    UPDATE

    We pulled this configuration out into a gem called Momentarily. Source is here https://github.com/eatenbyagrue/momentarily

提交回复
热议问题