문제

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