Created
May 13, 2009 02:14
-
-
Save julien51/110834 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require 'em/mysql' | |
EventedMysql.settings.update( | |
{ | |
:user => "superfeeder", | |
:host => "localhost", | |
:password => "********" | |
}) | |
puts "starting 1st loop" | |
EM.run { | |
EventedMysql.execute("SELECT 1+1;") { | |
puts "Done calculating 1+1" | |
EM.stop_event_loop | |
} | |
} | |
puts "starting 2nd loop" | |
EM.run { | |
EventedMysql.execute("SELECT 1+2;") { | |
puts "Done calculating 1+2" | |
EM.stop_event_loop | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment