Class: Hucpa::ConnectionPool
- Inherits:
-
Object
- Object
- Hucpa::ConnectionPool
- Defined in:
- lib/hucpa/connection_pool.rb
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(options) ⇒ ConnectionPool
constructor
A new instance of ConnectionPool.
- #open ⇒ Object
- #with_connection ⇒ Object
Constructor Details
#initialize(options) ⇒ ConnectionPool
Returns a new instance of ConnectionPool.
5 6 7 8 |
# File 'lib/hucpa/connection_pool.rb', line 5 def initialize() @options = @hikari_config = Configuration.new().to_hikari_config end |
Instance Method Details
#close ⇒ Object
14 15 16 |
# File 'lib/hucpa/connection_pool.rb', line 14 def close datasource.close end |
#open ⇒ Object
10 11 12 |
# File 'lib/hucpa/connection_pool.rb', line 10 def open datasource end |
#with_connection ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/hucpa/connection_pool.rb', line 18 def with_connection conn = datasource.connection yield conn ensure conn.close end |