Sha256: 4f734809ab1974fd0f34d00db275d3ab3542412d6934fce0c55a9a6eeba1f4e1
Contents?: true
Size: 464 Bytes
Versions: 8
Compression:
Stored size: 464 Bytes
Contents
# frozen_string_literal: false module SplitIoClient module SSE module EventSource class BackOff def initialize(back_off_base) @attempt = 0 @back_off_base = back_off_base end def interval interval = (@back_off_base * (2**@attempt)) if @attempt.positive? @attempt += 1 interval || 0 end def reset @attempt = 0 end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems