Sha256: cd9e326cc545266e2cba7b583e3613d6e2de509de312725f22277b953664d950
Contents?: true
Size: 483 Bytes
Versions: 110
Compression:
Stored size: 483 Bytes
Contents
# frozen_string_literal: false module SplitIoClient module SSE module EventSource class BackOff def initialize(back_off_base, attempt = 0) @attempt = attempt @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
110 entries across 110 versions & 1 rubygems