mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Add simple Sidekiq::Web example
This commit is contained in:
parent
38ea3b5c18
commit
34664e9215
2 changed files with 19 additions and 0 deletions
5
examples/web/Gemfile
Normal file
5
examples/web/Gemfile
Normal file
|
@ -0,0 +1,5 @@
|
|||
source 'https://rubygems.org'
|
||||
|
||||
gem 'sidekiq', path: '../../'
|
||||
gem 'thin'
|
||||
gem 'pry'
|
14
examples/web/config.ru
Normal file
14
examples/web/config.ru
Normal file
|
@ -0,0 +1,14 @@
|
|||
require 'sidekiq/web'
|
||||
require 'redis'
|
||||
|
||||
$redis = Redis.new
|
||||
|
||||
class SinatraWorker
|
||||
include Sidekiq::Worker
|
||||
|
||||
def perform(msg="lulz you forgot a msg!")
|
||||
$redis.lpush("sinkiq-example-messages", msg)
|
||||
end
|
||||
end
|
||||
|
||||
run Sidekiq::Web
|
Loading…
Add table
Reference in a new issue