Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A simple connection pool for Mysql2::EM connections
Ruby
tag: v0.0.1

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
README.textile
Rakefile
em_mysql2_connection_pool.gemspec
example.rb

README.textile

EmMysql2ConnectionPool

Usage:

conf = {
    :host => "localhost",
    :database => 'my_db',
    :reconnect => true,
    :username => "root",
    # :password => ''
}

my_query = "SELECT * FROM track WHERE in_progress != 0 LIMIT 10"

Mysql2::Client.default_query_options.merge! :symbolize_keys => true, :cast_booleans => true

MySQL = EmMysql2ConnectionPool.new conf

EM.run do
  MySQL.query my_query do |results|
    results.each do |result|
      p result
    end
    EM.stop
  end
end

Go ahead, try the example.

Something went wrong with that request. Please try again.