> time = Time.now
> sleep 2.seconds until Time.now > time + 10.seconds # breaks when true
> # or
> sleep 2 and puts 'still sleeping' until Time.now > time + 10
> # or
> sleep 1.seconds until !req.loading # suggested by ohsully
require 'sidekiq'
class PlainOldRuby
include Sidekiq::Worker
def perform(how_hard="super hard", how_long=10)
sleep how_long
puts "Workin' #{how_hard}"
end
end