I am working on a Rails application that allows you to download large music files. I would like to load them in the background so that when loading it is moved to the sidekiq handler while the user enters metadata about the file, such as the name of the track and artist, etc.
I was able to follow this railscast so that image processing moves to the background: http://railscasts.com/episodes/383-uploading-to-amazon-s3?view=asciicast
But I canβt understand how to transfer the actual file upload to the background. Is there any callback or Sidekiq method that I should use?
Are there any resources on how to do this?
Here is my song: https://gist.github.com/leemcalilly/5001583
My song controller: https://gist.github.com/leemcalilly/5001590
My download form: https://gist.github.com/leemcalilly/5001586
My bootloader (using carrier with carrier wave_direct on s3): https://gist.github.com/leemcalilly/5001601
This code works to load on s3, but the browser is connected to the Rails process during file upload. I would rather move this to a background process. The sidekiq code, I think, is really from Railscast, which handles image processing, but I donβt quite understand why image processing works in this Railscast.
Any help received in the right direction is greatly appreciated.
source share