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