Sha256: 69cc538af090201930b4ba176709c2f9eeacec2ce3f2c77b751b31d0e17cd959

Contents?: true

Size: 1020 Bytes

Versions: 18

Compression:

Stored size: 1020 Bytes

Contents

require 'sinatra/base'
require 'resque'
require 'job'

module Demo
  class App < Sinatra::Base
    get '/' do
      info = Resque.info
      out = "<html><head><title>Resque Demo</title></head><body>"
      out << "<p>"
      out << "There are #{info[:pending]} pending and "
      out << "#{info[:processed]} processed jobs across #{info[:queues]} queues."
      out << "</p>"
      out << '<form method="POST">'
      out << '<input type="submit" value="Create New Job"/>'
      out << '&nbsp;&nbsp;<a href="/resque/">View Resque</a>'
      out << '</form>'
      
       out << "<form action='/failing' method='POST''>"
       out << '<input type="submit" value="Create Failing New Job"/>'
       out << '&nbsp;&nbsp;<a href="/resque/">View Resque</a>'
       out << '</form>'
      
      out << "</body></html>"
      out
    end

    post '/' do
      Resque.enqueue(Job, params)
      redirect "/"
    end
    
    post '/failing' do 
      Resque.enqueue(FailingJob, params)
      redirect "/"
    end
  end
end

Version data entries

18 entries across 18 versions & 5 rubygems

Version Path
opengotham_resque-1.8.2 examples/demo/app.rb
resque-mongo-1.8.1 examples/demo/app.rb
resque-1.8.0 examples/demo/app.rb
resque-1.7.1 examples/demo/app.rb
resque-1.7.0 examples/demo/app.rb
resque-1.6.1 examples/demo/app.rb
resque-1.6.0 examples/demo/app.rb
resque-1.5.2 examples/demo/app.rb
resque-1.5.1 examples/demo/app.rb
scotttam-resque-0.0.5 examples/demo/app.rb
scotttam-resque-0.0.4 examples/demo/app.rb
scotttam-resque-0.0.3 examples/demo/app.rb
scotttam-resque-0.0.2 examples/demo/app.rb
scotttam-resque-0.0.1 examples/demo/app.rb
grockit-resque-1.5.0 examples/demo/app.rb
resque-1.5.0 examples/demo/app.rb
resque-mongo-1.4.0 examples/demo/app.rb
resque-1.4.0 examples/demo/app.rb