A
A
Alexander Gonchurin2015-03-21 14:25:31
Ruby on Rails
Alexander Gonchurin, 2015-03-21 14:25:31

How to work with background tasks on the server?

I've been struggling for a long time and can't deal with background tasks on Rails. As I understand it, there is no point in deploying a more or less costly application to Hiroku (if there are more than one task), or am I wrong?)
Second, how to implement this using sidekiq? Is there any guide on setting it up on a remote server or on the same Heroku?
My experience with Heroku is not entirely successful, when you run through the console bundle exec sidekiqit automatically starts all available workers, how to deal with this? Or do you not even need to do this, but just call the worker through rake or the application controller?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Kane, 2015-03-21
@Kane

Sidekiq works like this: you run it on the server, it raises a given number of workers and waits until new tasks appear. That is why such tasks are called background tasks.

N
Nikolai Markov, 2015-04-01
@manameiz

If you do not want it to run all the workers, then you need to specify the name of the queue in the workers and run a sidekick to process only this queue sidekiq -q queue_name (see sidekiq --help)

D
Dmitry, 2015-07-19
@deemytch

https://www.ruby-toolbox.com/categories/Background_Jobs

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question