Class: Mysql2::EM::Client
Defined Under Namespace
Modules: Watcher
Constant Summary
Constant Summary
Constants inherited from Client
Client::CHARSET_MAP, Client::MYSQL_CHARSET_MAP
Instance Attribute Summary
Attributes inherited from Client
Instance Method Summary (collapse)
Methods inherited from Client
#affected_rows, #async_result, #charset_name=, #close, #connect, #connect_timeout=, default_query_options, #encoding, encoding_from_charset, encoding_from_charset_code, escape, #escape, #info, #init_connection, #initialize, #last_id, #ping, #reconnect=, #server_info, #socket, #ssl_set, #thread_id
Constructor Details
This class inherits a constructor from Mysql2::Client
Instance Method Details
- (Object) query(sql, opts = {})
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/mysql2/em.rb', line 25 def query(sql, opts={}) if ::EM.reactor_running? super(sql, opts.merge(:async => true)) deferable = ::EM::DefaultDeferrable.new ::EM.watch(self.socket, Watcher, self, deferable).notify_readable = true deferable else super(sql, opts) end end |