Sha256: 6f8c452900ffc19f69ea9d387bf9644d0bb72e7e3ef8fb9808cbde764cce6277

Contents?: true

Size: 804 Bytes

Versions: 15

Compression:

Stored size: 804 Bytes

Contents

class WorkController < ApplicationController
  def index
    @count = rand(100)
    puts "Adding #{@count} jobs"
    @count.times do |x|
      HardWorker.perform_async('bubba', 0.01, x)
    end
  end

  def email
    UserMailer.delay.greetings(Time.now)
    render :nothing => true
  end

  def long
    50.times do |x|
      HardWorker.perform_async('bob', 10, x)
    end
    render :text => 'enqueued'
  end

  def crash
    HardWorker.perform_async('crash', 1, Time.now.to_f)
    render :text => 'enqueued'
  end

  def delayed_post
    p = Post.first
    unless p
      p = Post.create!(:title => "Title!", :body => 'Body!')
      p2 = Post.create!(:title => "Other!", :body => 'Second Body!')
    else
      p2 = Post.second
    end
    p.delay.long_method(p2)
    render :nothing => true
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
kulesa-sidekiq-1.2.3 myapp/app/controllers/work_controller.rb
kulesa-sidekiq-1.2.2 myapp/app/controllers/work_controller.rb
sidekiq-1.2.1 myapp/app/controllers/work_controller.rb
sidekiq-1.2.0 myapp/app/controllers/work_controller.rb
sidekiq-1.1.4 myapp/app/controllers/work_controller.rb
sidekiq-1.1.3 myapp/app/controllers/work_controller.rb
sidekiq-1.1.2 myapp/app/controllers/work_controller.rb
sidekiq-1.1.1 myapp/app/controllers/work_controller.rb
sidekiq-1.1.0 myapp/app/controllers/work_controller.rb
sidekiq-1.0.0 myapp/app/controllers/work_controller.rb
sidekiq-0.11.2 myapp/app/controllers/work_controller.rb
sidekiq-0.11.1 myapp/app/controllers/work_controller.rb
sidekiq-0.11.0 myapp/app/controllers/work_controller.rb
sidekiq-0.10.1 myapp/app/controllers/work_controller.rb
sidekiq-0.10.0 myapp/app/controllers/work_controller.rb