rate_throttle

Throttle load of block by calling sleep.

Example

require 'rate_throttle'

1000.times do
    # limit block to 10% workload.
    RateThrottle.throttle(0.1) do
        # do something.
    end
end

Contributing to rate_throttle

Thanks

Kazuho Oku: This library is based from Sub::Throttle search.cpan.org/~kazuho/Sub-Throttle-0.02/lib/Sub/Throttle.pm

Copyright © 2012 Keiji, Yoshimi. See LICENSE.txt for further details.