1
0
Fork 0
mirror of https://github.com/endofunky/sidetiq.git synced 2022-11-09 13:53:30 -05:00

Add a quicker running example.

This commit is contained in:
Tobias Svensson 2013-02-01 17:39:38 +00:00
parent 8fe6e60fc8
commit 45bf3a24ba

View file

@ -1,19 +1,18 @@
# Run with `sidekiq -r /path/to/simple.rb`
require 'sidekiq'
require 'sidetiq'
# We're only loading this so we don't actually have to connect to redis.
require 'sidekiq/testing'
Sidekiq.options[:poll_interval] = 1
class ExampleWorker
class MyWorker
include Sidekiq::Worker
include Sidetiq::Schedulable
def self.perform_at(time)
puts "Enqueued to run at #{time}"
end
tiq { secondly }
# Run every 2 seconds
tiq { secondly(2) }
def perform(*args)
Sidekiq.logger.info "#perform"
end
end
puts "Hit C-c to quit."
sleep 1000000