0

We use Sidekiq to process background jobs, such as this:

def process_order(id)
... do something
end

Sidekiq is set to 50-100 threads, so we've seen process_order run on the same id at the same time, which we don't want. What is the best way to ensure process_order do not run on the same id concurrently?

I looked into https://ruby-concurrency.github.io/concurrent-ruby/master/Concurrent/Async.html but the example isn't very clear (for a newbie).

1 Answer 1

0

You're looking for the unique jobs feature. Sidekiq Enterprise has it and there are 3rd party plugins which also provide it.

50-100 threads is way too much. Ruby doesn't scale well to that many threads.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.