Class: Green::Mysql2::Client

Inherits:
Mysql2::Client
  • Object
show all
Defined in:
lib/green/mysql2.rb

Instance Method Summary collapse

Instance Method Details

#green_waiterObject



11
12
13
# File 'lib/green/mysql2.rb', line 11

def green_waiter
  @green_waiter ||= Green.hub.socket_waiter(Socket.for_fd(self.socket))
end

#query(sql, opts = {}) ⇒ Object



5
6
7
8
9
# File 'lib/green/mysql2.rb', line 5

def query(sql, opts={})
  super(sql, opts.merge(:async => true))
  green_waiter.wait_read
  async_result
end