Class: Bundler::ConnectionPool::Wrapper
- Inherits:
-
BasicObject
- Defined in:
- lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb
Constant Summary
collapse
- METHODS =
[:with, :pool_shutdown, :wrapped_pool]
Instance Method Summary
collapse
Constructor Details
permalink
#initialize(options = {}, &block) ⇒ Wrapper
Returns a new instance of Wrapper.
[View source]
5
6
7
|
# File 'lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb', line 5
def initialize(options = {}, &block)
@pool = options.fetch(:pool) { ::Bundler::ConnectionPool.new(options, &block) }
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
permalink
#method_missing(name, *args, &block) ⇒ Object
[View source]
35
36
37
38
39
|
# File 'lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb', line 35
def method_missing(name, *args, **kwargs, &block)
with do |connection|
connection.send(name, *args, **kwargs, &block)
end
end
|
Instance Method Details
permalink
#pool_available ⇒ Object
[View source]
25
26
27
|
# File 'lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb', line 25
def pool_available
@pool.available
end
|
permalink
#pool_shutdown(&block) ⇒ Object
[View source]
17
18
19
|
# File 'lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb', line 17
def pool_shutdown(&block)
@pool.shutdown(&block)
end
|
permalink
#pool_size ⇒ Object
[View source]
21
22
23
|
# File 'lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb', line 21
def pool_size
@pool.size
end
|
permalink
#respond_to?(id, *args) ⇒ Boolean
[View source]
29
30
31
|
# File 'lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb', line 29
def respond_to?(id, *args)
METHODS.include?(id) || with { |c| c.respond_to?(id, *args) }
end
|
permalink
#with(&block) ⇒ Object
[View source]
13
14
15
|
# File 'lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb', line 13
def with(&block)
@pool.with(&block)
end
|
permalink
#wrapped_pool ⇒ Object
[View source]
9
10
11
|
# File 'lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb', line 9
def wrapped_pool
@pool
end
|