Say I want to have a ruby process that does something like this:

loop do
 sleep(5)
 check_redis()
 do_something()
end

I want to run it alongside Rails. Can this be done on the same dyno or having separate-anything besides one dyno will automatically require payment?

有帮助吗?

解决方案

A worker is just a name given to a Dyno. You usually have a web Dyno, but you can create others in your Procfile and give them arbitrary names.

Many processes can be spawned by one Dyno. For example, the Unicorn web server does this.

You might be able to use Rufus Scheduler for what you need to do, but I think it would be more sensible to use a separate worker Dyno.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top