2013-02-01 12:39:38 -05:00
|
|
|
# Run with `sidekiq -r /path/to/simple.rb`
|
|
|
|
|
|
|
|
require 'sidekiq'
|
2013-01-31 12:42:19 -05:00
|
|
|
require 'sidetiq'
|
|
|
|
|
2013-02-01 12:39:38 -05:00
|
|
|
Sidekiq.options[:poll_interval] = 1
|
2013-01-31 12:42:19 -05:00
|
|
|
|
2013-02-04 06:43:48 -05:00
|
|
|
Sidekiq.configure_server do |config|
|
|
|
|
Sidetiq::Clock.start!
|
|
|
|
end
|
|
|
|
|
2013-02-01 12:39:38 -05:00
|
|
|
class MyWorker
|
2013-01-31 12:42:19 -05:00
|
|
|
include Sidekiq::Worker
|
|
|
|
include Sidetiq::Schedulable
|
|
|
|
|
2013-02-01 12:39:38 -05:00
|
|
|
tiq { secondly }
|
2013-01-31 12:42:19 -05:00
|
|
|
|
2013-02-01 12:39:38 -05:00
|
|
|
def perform(*args)
|
|
|
|
Sidekiq.logger.info "#perform"
|
|
|
|
end
|
2013-01-31 12:42:19 -05:00
|
|
|
end
|
|
|
|
|