Class: Upfluence::Utils::Thrift::Middleware::ConnectionPooler
- Inherits:
-
Object
- Object
- Upfluence::Utils::Thrift::Middleware::ConnectionPooler
- Defined in:
- lib/upfluence/utils/thrift/middleware/connection_pooler.rb
Instance Method Summary collapse
-
#initialize(app) ⇒ ConnectionPooler
constructor
A new instance of ConnectionPooler.
- #method_missing(method, *args, &block) ⇒ Object
Constructor Details
#initialize(app) ⇒ ConnectionPooler
Returns a new instance of ConnectionPooler.
8 9 10 |
# File 'lib/upfluence/utils/thrift/middleware/connection_pooler.rb', line 8 def initialize(app) @app = app end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
12 13 14 15 16 |
# File 'lib/upfluence/utils/thrift/middleware/connection_pooler.rb', line 12 def method_missing(method, *args, &block) ActiveRecord::Base.connection_pool.with_connection do @app.send(method, *args, &block) end end |