我有一个在 Heroku 上运行的应用程序,并且我有一个消息传递系统。我使用了 Faye gem,它有一个 Faye 服务器来处理实时消息通知。
我怎样才能让这个 Faye 服务器在 Heroku 上运行?
它有自己的端口和 ENV 变量。
请指教。
最佳答案
如果它是自己的服务器,则必须将其作为后台作业运行。
https://devcenter.heroku.com/articles/background-jobs-queueing
您可以从 rake 任务中启动它。
https://devcenter.heroku.com/articles/rake
您可以按计划运行它,如果运行时间很长,甚至每月运行一次。
https://devcenter.heroku.com/articles/scheduler
使用heroku config
查看环境变量。 heroku config:set
分派(dispatch)。
使用heroku run bash
得到一个贝壳。
您可能必须使用 Heroku 仪表板中的额外工作线程。
关于ruby-on-rails - 如何让 Faye 在 Heroku 上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21207280/