# class Raven::ClientState

### Public Class Methods

new() click to toggle source

    # File lib/raven/client.rb, line 127
    def initialize
      reset
    end

### Public Instance Methods

failed?() click to toggle source

    # File lib/raven/client.rb, line 158
    def failed?
      @status == :error
    end

failure(retry_after = nil) click to toggle source

    # File lib/raven/client.rb, line 140
    def failure(retry_after = nil)
      @status = :error
      @retry_number += 1
      @last_check = Time.now
      @retry_after = retry_after
    end

reset() click to toggle source

    # File lib/raven/client.rb, line 151
    def reset
      @status = :online
      @retry_number = 0
      @last_check = nil
      @retry_after = nil
    end

should_try?() click to toggle source

    # File lib/raven/client.rb, line 131
    def should_try?
      return true if @status == :online

      interval = @retry_after || [@retry_number, 6].min**2
      return true if Time.now - @last_check >= interval

      false
    end

success() click to toggle source

    # File lib/raven/client.rb, line 147
    def success
      reset
    end