mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Adding plain old Ruby example
This commit is contained in:
parent
8a9188d931
commit
f3654bef5a
1 changed files with 17 additions and 0 deletions
17
examples/por.rb
Normal file
17
examples/por.rb
Normal file
|
@ -0,0 +1,17 @@
|
|||
require 'sidekiq'
|
||||
|
||||
# Start up sidekiq via
|
||||
# ./bin/sidekiq -r ./examples/por.rb
|
||||
# and then you can open up an IRB session like so:
|
||||
# irb -r ./examples/por.rb
|
||||
# where you can then say
|
||||
# PlainOldRuby.perform_async "like a dog", 3
|
||||
#
|
||||
class PlainOldRuby
|
||||
include Sidekiq::Worker
|
||||
|
||||
def perform(how_hard="super hard", how_long=1)
|
||||
sleep how_long
|
||||
puts "Workin' #{how_hard}"
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue