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).