Class: NeverBlock::DB::PooledMySQL

Inherits:
Connection show all
Defined in:
lib/neverblock/io/db/drivers/mysql.rb

Overview

MySQL

Instance Method Summary collapse

Methods inherited from Connection

#method_missing, #query, #replace_acquired_connection, #respond_to?

Constructor Details

#initialize(*args) ⇒ PooledMySQL

Returns a new instance of PooledMySQL.



53
54
55
56
57
58
59
60
61
62
63
# File 'lib/neverblock/io/db/drivers/mysql.rb', line 53

def initialize(*args)
  options = {}
  if args #&& (options = args.last).is_a? Hash
    size = options[:size] || 4
    eager = options[:eager] || true
    args.pop
  end
  @pool = NB::DB::Pool.new(:size=>size, :eager=>eager) do
    MySQL.new(*args)
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class NeverBlock::DB::Connection