1
0
Fork 0
mirror of https://github.com/endofunky/sidetiq.git synced 2022-11-09 13:53:30 -05:00
endofunky--sidetiq/examples/simple.rb
2013-01-31 17:42:19 +00:00

19 lines
359 B
Ruby

require 'sidetiq'
# We're only loading this so we don't actually have to connect to redis.
require 'sidekiq/testing'
class ExampleWorker
include Sidekiq::Worker
include Sidetiq::Schedulable
def self.perform_at(time)
puts "Enqueued to run at #{time}"
end
# Run every 2 seconds
tiq { secondly(2) }
end
puts "Hit C-c to quit."
sleep 1000000