Sha256: 026b84b28879285a663d170b96af914b40ee80d874758d4e5dd47013801c676d
Contents?: true
Size: 358 Bytes
Versions: 12
Compression:
Stored size: 358 Bytes
Contents
module Prefab class ExponentialBackoff def initialize(max_delay:, initial_delay: 2, multiplier: 2) @initial_delay = initial_delay @max_delay = max_delay @multiplier = multiplier @delay = initial_delay end def call delay = @delay @delay = [@delay * @multiplier, @max_delay].min delay end end end
Version data entries
12 entries across 12 versions & 1 rubygems