Class: Balancir::Connector

Inherits:
Object
  • Object
show all
Defined in:
lib/balancir/connector.rb

Overview

Represents a connection to a particular server

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#connectionObject

Returns the value of attribute connection.



4
5
6
# File 'lib/balancir/connector.rb', line 4

def connection
  @connection
end

#randomObject

Returns the value of attribute random.



4
5
6
# File 'lib/balancir/connector.rb', line 4

def random
  @random
end

#recent_errorsObject

Returns the value of attribute recent_errors.



4
5
6
# File 'lib/balancir/connector.rb', line 4

def recent_errors
  @recent_errors
end

Instance Method Details

#clear_errorsObject



6
7
8
# File 'lib/balancir/connector.rb', line 6

def clear_errors
  @recent_errors = []
end

#record_errorObject



10
11
12
# File 'lib/balancir/connector.rb', line 10

def record_error
  @recent_errors << true
end