質問

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