2012-02-20 12:46:28 -05:00
|
|
|
Sidekiq.configure_client do |config|
|
2016-05-31 13:01:45 -04:00
|
|
|
config.redis = { :size => 2 }
|
2012-02-20 12:46:28 -05:00
|
|
|
end
|
|
|
|
Sidekiq.configure_server do |config|
|
2015-09-21 17:50:00 -04:00
|
|
|
config.on(:startup) { }
|
|
|
|
config.on(:quiet) { }
|
|
|
|
config.on(:shutdown) do
|
|
|
|
#result = RubyProf.stop
|
|
|
|
|
|
|
|
## Write the results to a file
|
|
|
|
## Requires railsexpress patched MRI build
|
|
|
|
# brew install qcachegrind
|
|
|
|
#File.open("callgrind.profile", "w") do |f|
|
|
|
|
#RubyProf::CallTreePrinter.new(result).print(f, :min_percent => 1)
|
|
|
|
#end
|
|
|
|
end
|
2012-02-19 16:02:32 -05:00
|
|
|
end
|
2013-04-26 12:00:03 -04:00
|
|
|
|
2014-08-01 19:40:42 -04:00
|
|
|
require 'sidekiq/web'
|
|
|
|
Sidekiq::Web.app_url = '/'
|
|
|
|
|
2013-04-26 12:00:03 -04:00
|
|
|
class EmptyWorker
|
|
|
|
include Sidekiq::Worker
|
|
|
|
|
|
|
|
def perform
|
|
|
|
end
|
|
|
|
end
|
2015-10-08 13:19:55 -04:00
|
|
|
|
|
|
|
class TimedWorker
|
|
|
|
include Sidekiq::Worker
|
|
|
|
|
|
|
|
def perform(start)
|
|
|
|
now = Time.now.to_f
|
|
|
|
puts "Latency: #{now - start} sec"
|
|
|
|
end
|
|
|
|
end
|
2017-01-04 13:30:42 -05:00
|
|
|
|
|
|
|
Sidekiq::Extensions.enable_delay!
|