lib/polyphony/core/throttler.rb
# call-seq:
#   throttler.call { ... }
#   throttler.process { ... }
#
# Invokes the throttler with the given block. The throttler will
# automatically introduce a delay to keep to the maximum specified rate.
# The throttler instance is passed to the given block.
#
# @return [any] given block's return value


Invokes the throttler with the given block. The throttler will
automatically introduce a delay to keep to the maximum specified rate.
The throttler instance is passed to the given block.
Invokes the throttler with the given block . The throttler will automatically introduce a delay to keep to the maximum specified rate . The throttler instance is passed to the given block .
def call
      now = ::Process.clock_gettime(::Process::CLOCK_MONOTONIC)
      delta = @next_time - now
      Polyphony.backend_sleep(delta) if delta > 0
      result = yield self
      while true
        @next_time += @min_dt
        break if @next_time > now
      end
      result
    end
def call now = :: Process . clock_gettime ( :: Process :: CLOCK_MONOTONIC ) delta = @next_time - now Polyphony . backend_sleep ( delta ) if delta > 0 result = yield self while true @next_time += @min_dt break if @next_time > now end result end
call-seq:
throttler.call { ... }
throttler.process { ... }
call - seq : throttler . call { ... } throttler . process { ... }
given block's return value
given block ' s return value
any