Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top