Class: Green::ConnectionPool::Proxy

Inherits:
BasicObject
Defined in:
lib/green/connection_pool.rb

Instance Method Summary collapse

Constructor Details

#initialize(pool) ⇒ Proxy

Returns a new instance of Proxy.



4
5
6
# File 'lib/green/connection_pool.rb', line 4

def initialize(pool)
  @pool = pool
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &blk) ⇒ Object



8
9
10
11
12
# File 'lib/green/connection_pool.rb', line 8

def method_missing(method, *args, &blk)
  @pool.execute do |conn|
    conn.__send__(method, *args, &blk)
  end
end