Class: EventMachine::MySQL

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

Instance Method Summary collapse

Instance Method Details

#aqueryObject



6
# File 'lib/em-synchrony/em-mysql.rb', line 6

alias :aquery :query

#query(sql, &blk) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/em-synchrony/em-mysql.rb', line 7

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