Sha256: 0a47f98eaa2497f6983b4e66fc49465f7dcdee923801e0651afefc8f02a561b2
Contents?: true
Size: 700 Bytes
Versions: 12
Compression:
Stored size: 700 Bytes
Contents
module Sidetiq module Actor class Clock < Sidetiq::Clock include Sidetiq::Actor include Sidekiq::ExceptionHandler def initialize(*args, &block) super if Sidekiq.server? after(0) do debug "Sidetiq::Clock looping ..." loop! end end end private def loop! after([time { tick }, 0].max) do loop! end rescue StandardError => e handle_exception(e, context: 'Sidetiq::Clock#loop!') raise e end def time start = gettime yield Sidetiq.config.resolution - (gettime.to_f - start.to_f) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems