Sha256: ccffd5fbe49bbd029aea56a7e3e54c3f27342cfc3d3c3aa5579df028c9faffd1

Contents?: true

Size: 820 Bytes

Versions: 8

Compression:

Stored size: 820 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_for(30.seconds).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

8 entries across 8 versions & 1 rubygems

Version Path
sidekiq-2.2.1 myapp/app/controllers/work_controller.rb
sidekiq-2.2.0 myapp/app/controllers/work_controller.rb
sidekiq-2.1.1 myapp/app/controllers/work_controller.rb
sidekiq-2.1.0 myapp/app/controllers/work_controller.rb
sidekiq-2.0.3 myapp/app/controllers/work_controller.rb
sidekiq-2.0.2 myapp/app/controllers/work_controller.rb
sidekiq-2.0.1 myapp/app/controllers/work_controller.rb
sidekiq-2.0.0 myapp/app/controllers/work_controller.rb