Sidekiq for background jobs

This commit is contained in:
Marcin Kulik 2012-04-06 14:32:01 +02:00
parent da3ec8aca1
commit da7a9532df
3 changed files with 16 additions and 1 deletions

View File

@ -17,6 +17,7 @@ gem 'faker'
gem 'fog'
gem 'simple_form'
gem 'redcarpet'
gem 'sidekiq'
# Gems used only for assets and not required
# in production environments by default.

View File

@ -54,6 +54,7 @@ GEM
xpath (~> 0.1.4)
carrierwave (0.5.8)
activesupport (~> 3.0)
celluloid (0.10.0)
childprocess (0.3.0)
ffi (~> 1.0.6)
coffee-rails (3.2.2)
@ -67,6 +68,7 @@ GEM
commonjs (0.2.0)
therubyracer (~> 0.9.9)
confstruct (0.2.1)
connection_pool (0.9.1)
diff-lcs (1.1.3)
erubis (2.7.0)
excon (0.9.6)
@ -201,6 +203,9 @@ GEM
rdoc (3.12)
json (~> 1.4)
redcarpet (2.1.0)
redis (2.2.2)
redis-namespace (1.1.0)
redis (< 3.0.0)
rspec (2.8.0)
rspec-core (~> 2.8.0)
rspec-expectations (~> 2.8.0)
@ -236,6 +241,12 @@ GEM
ffi (~> 1.0.9)
json_pure
rubyzip
sidekiq (0.11.1)
celluloid (~> 0.10.0)
connection_pool (~> 0.9.0)
multi_json
redis
redis-namespace
simple_form (1.5.2)
actionpack (~> 3.0)
activemodel (~> 3.0)
@ -298,6 +309,7 @@ DEPENDENCIES
rspec-rails
ruby-debug19
sass-rails
sidekiq
simple_form
tailor
twitter-bootstrap-rails

View File

@ -1,7 +1,9 @@
require 'tempfile'
class ThumbnailWorker
def self.perform(asciicast_id)
include Sidekiq::Worker
def perform(asciicast_id)
asciicast = Asciicast.find(asciicast_id)
in_data_file = Tempfile.new('asciiio-data', :encoding => 'ascii-8bit')