我在看一些项目的部署文档时,有些人提到了 Foreman,看样子它是用来守护进程的。比如 puma/sidekiq/racecar 之类的进程挂了,foreman 可以自动把它们启动。
https://github.com/zendesk/racecar#deploying-consumers
If you're already deploying your Rails application using e.g. Capistrano, all you need to do to run your Racecar consumers in production is to have some process supervisor start the processes and manage them for you.
Foreman is a very straightford tool for interfacing with several process supervisor systems. You define your process types in a Procfile, e.g.
racecar-process-payments: bundle exec racecar ProcessPaymentsConsumer racecar-resize-images: bundle exec racecar ResizeImagesConsumer
熟悉 Linux 的朋友,可以讲一讲历史岁月吗?