steve lee
Export large file in Rails with Sidekiq
In some systems, you'll have to do something very slow. Maybe you need to export a large dataset to a CSV file, or need to generate a thousand row Exel file that takes some minutes to complete.
Instead of try building these kinds of reports in a normal Rails controller action, this task should be moved into a background job for processing outside the life cycle of a single HTTP request.
But when you move work to a background job, code execution does not stop and you need a way to “connect” back to the user that caused the…