public
Description: Trivial async MySQL driver for Ruby EventMachine
Homepage:
Clone URL: git://github.com/tqbf/asymy.git
asymy / test.rb
100755 19 lines (16 sloc) 0.447 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env ruby
 
require 'rubygems'
require 'eventmachine'
require 'pp'
require 'asymy'
 
EventMachine::run {
    c = Asymy::Connection.new(:target => "localhost",
                              :port => 13306,
                              :username => "dummy",
                              :password => "helu",
                              :database => "mysql")
    c.exec("select * from user") do |x, y|
        pp x
        pp y
    end
}