Skip to content

Commit

Permalink
EM.attach is bundled with >= 0.12.2; Blurb about sequel/async
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm1 committed Jun 29, 2009
1 parent 9f4d302 commit f79ac4a
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions README
Expand Up @@ -2,7 +2,7 @@ Async MySQL driver for Ruby/EventMachine
(c) 2008 Aman Gupta (tmm1)


Requires mysqlplus and the EM.attach patch.
Requires mysqlplus.

require 'em/mysql'

Expand All @@ -25,4 +25,16 @@ Requires mysqlplus and the EM.attach patch.
SQL('select sleep(0.25)'){ p 'done' }
SQL('select sleep(0.25)'){ p 'done' }
SQL('select sleep(0.25)'){ p 'done' }
SQL('select sleep(0.25)'){ p 'done' }
SQL('select sleep(0.25)'){ p 'done' }

Also includes a sequel async wrapper

require 'sequel'
require 'sequel/async'

DB = Sequel.connect(:adapter => 'mysql', :user => 'root', :database => 'test', ...)
EventedMysql.settings.update(..., :on_error => proc{|e| log 'error', e })

DB[:table].where(:field => 'value').async_update(:field => 'new value')

For more info, see the comments in lib/sequel/async.rb

0 comments on commit f79ac4a

Please sign in to comment.