Class: EzPool::ConnectionWrapper
- Inherits:
-
Object
- Object
- EzPool::ConnectionWrapper
- Defined in:
- lib/ezpool/connection_wrapper.rb
Instance Attribute Summary collapse
-
#raw_conn ⇒ Object
readonly
Returns the value of attribute raw_conn.
Instance Method Summary collapse
- #age ⇒ Object
-
#initialize(conn, connection_manager) ⇒ ConnectionWrapper
constructor
A new instance of ConnectionWrapper.
-
#shutdown! ⇒ Object
Shut down the connection.
Constructor Details
#initialize(conn, connection_manager) ⇒ ConnectionWrapper
Returns a new instance of ConnectionWrapper.
6 7 8 9 10 |
# File 'lib/ezpool/connection_wrapper.rb', line 6 def initialize(conn, connection_manager) @raw_conn = conn @created_at = EzPool.monotonic_time @manager = connection_manager end |
Instance Attribute Details
#raw_conn ⇒ Object (readonly)
Returns the value of attribute raw_conn.
4 5 6 |
# File 'lib/ezpool/connection_wrapper.rb', line 4 def raw_conn @raw_conn end |
Instance Method Details
#age ⇒ Object
17 18 19 |
# File 'lib/ezpool/connection_wrapper.rb', line 17 def age EzPool.monotonic_time - @created_at end |
#shutdown! ⇒ Object
Shut down the connection. Can no longer be used after this!
13 14 15 |
# File 'lib/ezpool/connection_wrapper.rb', line 13 def shutdown! @manager.disconnect(@raw_conn) end |