mirror of
https://github.com/endofunky/sidetiq.git
synced 2022-11-09 13:53:30 -05:00
Setup example code to boot bot, sidekiq & web app.
This commit is contained in:
parent
0291e6981f
commit
d9b30f7cfe
4 changed files with 27 additions and 11 deletions
2
examples/Procfile
Normal file
2
examples/Procfile
Normal file
|
@ -0,0 +1,2 @@
|
|||
sidekiq: bundle exec sidekiq -r ./server.rb
|
||||
web: bundle exec rackup
|
13
examples/config.ru
Normal file
13
examples/config.ru
Normal file
|
@ -0,0 +1,13 @@
|
|||
require 'sidekiq'
|
||||
require 'sidetiq'
|
||||
|
||||
require 'sidekiq/web'
|
||||
require 'sidetiq/web'
|
||||
|
||||
require './workers/simple.rb'
|
||||
|
||||
Sidekiq.configure_client do |config|
|
||||
config.redis = { :size => 1 }
|
||||
end
|
||||
|
||||
run Sidekiq::Web
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
require 'sidekiq'
|
||||
require 'sidetiq'
|
||||
require_relative 'workers/simple'
|
||||
|
||||
Sidekiq.logger.level = Logger::DEBUG
|
||||
|
||||
|
@ -11,14 +12,3 @@ Sidekiq.configure_server do |config|
|
|||
Sidetiq.clock.start!
|
||||
end
|
||||
|
||||
class MyWorker
|
||||
include Sidekiq::Worker
|
||||
include Sidetiq::Schedulable
|
||||
|
||||
recurrence { secondly }
|
||||
|
||||
def perform(*args)
|
||||
Sidekiq.logger.info "#perform"
|
||||
end
|
||||
end
|
||||
|
11
examples/workers/simple.rb
Normal file
11
examples/workers/simple.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
class Simple
|
||||
include Sidekiq::Worker
|
||||
include Sidetiq::Schedulable
|
||||
|
||||
recurrence { secondly }
|
||||
|
||||
def perform(*args)
|
||||
Sidekiq.logger.info "#perform"
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in a new issue