Rails and Que jobs

640 Views Asked by At

Before I use sidekiq but now I decided to move to que and store everything in Postgresql. Because I don't need redis high-perfomance features I wanted to decrease dependency my application from external components. I add gem 'que', installed it and wrote in application.rb:

config.active_job.queue_adapter = :que

All jobs I inhereted from ActiveJob::Base

But I doesn't understand how to run background task in separate thread like I do it with sidekiq (I run by rake command rake sidekiq:start)

2

There are 2 best solutions below

0
On

There is an executable que available. So, you just need to run que. To learn more about options run que -h.

0
On

You need to set Que.mode = :async to enable background workers.

You'll want to place that in an initializer file.