Class: Familia::Connection::CreateConnectionHandler
- Inherits:
-
Object
- Object
- Familia::Connection::CreateConnectionHandler
- Includes:
- Handler
- Defined in:
- lib/familia/connection/handlers.rb
Overview
Creates new connections directly, with no caching of any kind. If the make it to here in the chain, it'll create a new connection every time.
Fresh connection each time - all operations safe (transactions, pipelined, ad-hoc)
Instance Method Summary collapse
- #handle(uri) ⇒ Object
-
#initialize(familia_module = nil) ⇒ CreateConnectionHandler
constructor
A new instance of CreateConnectionHandler.
Constructor Details
#initialize(familia_module = nil) ⇒ CreateConnectionHandler
Returns a new instance of CreateConnectionHandler.
104 105 106 |
# File 'lib/familia/connection/handlers.rb', line 104 def initialize(familia_module = nil) @familia_module = familia_module || Familia end |
Instance Method Details
#handle(uri) ⇒ Object
108 109 110 111 112 113 114 |
# File 'lib/familia/connection/handlers.rb', line 108 def handle(uri) # Create new connection (no module-level caching) parsed_uri = @familia_module.normalize_uri(uri) client = @familia_module.create_dbclient(parsed_uri) Familia.trace :DBCLIENT_DEFAULT, nil, "Created new connection for #{parsed_uri.serverid}" client end |