Class: EventMachine::MySQL

Inherits:
Object
  • Object
show all
Defined in:
lib/em-synchrony/em-mysqlplus.rb

Instance Method Summary collapse

Instance Method Details

#aqueryObject



10
# File 'lib/em-synchrony/em-mysqlplus.rb', line 10

alias :aquery :query

#query(sql, &blk) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/em-synchrony/em-mysqlplus.rb', line 11

def query(sql, &blk)
  f = Fiber.current

  # TODO: blk case does not work. Hmm?
  cb = Proc.new { |r| f.resume(r) }
  eb = Proc.new { |r| f.resume(r) }

  @connection.execute(sql, cb, eb)

  Fiber.yield
end