Sha256: 19db58dee1d7d9ed2d8d023d55cb5987afabeba09f6ca802b0813a585b276885

Contents?: true

Size: 463 Bytes

Versions: 41

Compression:

Stored size: 463 Bytes

Contents

# encoding: utf-8

$LOAD_PATH.unshift 'lib'

require 'rubygems'
require 'eventmachine'
require 'mysql2/em'

EM.run do
  client1 = Mysql2::EM::Client.new
  defer1 = client1.query "SELECT sleep(3) as first_query"
  defer1.callback do |result|
    puts "Result: #{result.to_a.inspect}"
  end

  client2 = Mysql2::EM::Client.new
  defer2 = client2.query "SELECT sleep(1) second_query"
  defer2.callback do |result|
    puts "Result: #{result.to_a.inspect}"
  end
end

Version data entries

41 entries across 41 versions & 2 rubygems

Version Path
mysql2-0.4.10-x86-mswin32-60 examples/eventmachine.rb
mysql2-0.4.10-x86-mingw32 examples/eventmachine.rb
mysql2-0.4.10-x64-mingw32 examples/eventmachine.rb
mysql2-0.4.10 examples/eventmachine.rb
mysql2-0.4.9-x86-mswin32-60 examples/eventmachine.rb
mysql2-0.4.9-x86-mingw32 examples/eventmachine.rb
mysql2-0.4.9-x64-mingw32 examples/eventmachine.rb
mysql2-0.4.9 examples/eventmachine.rb
mysql2-0.4.8-x86-mswin32-60 examples/eventmachine.rb
mysql2-0.4.8-x86-mingw32 examples/eventmachine.rb
mysql2-0.4.8-x64-mingw32 examples/eventmachine.rb
mysql2-0.4.8 examples/eventmachine.rb
mysql2-0.4.7-x86-mswin32-60 examples/eventmachine.rb
mysql2-0.4.7-x86-mingw32 examples/eventmachine.rb
mysql2-0.4.7-x64-mingw32 examples/eventmachine.rb
mysql2-0.4.7 examples/eventmachine.rb
mysql2-0.4.6-x86-mswin32-60 examples/eventmachine.rb
mysql2-0.4.6-x86-mingw32 examples/eventmachine.rb
mysql2-0.4.6-x64-mingw32 examples/eventmachine.rb
mysql2-0.4.6 examples/eventmachine.rb