# class Mysql2::EM::Client

### Public Instance Methods

close(*args) click to toggle source
Calls superclass method Mysql2::Client#close

    # File lib/mysql2/em.rb, line 35
    def close(*args)
      if @watch
        @watch.detach if @watch.watching?
      end
      super(*args)
    end

query(sql, opts={}) click to toggle source
Calls superclass method Mysql2::Client#query

    # File lib/mysql2/em.rb, line 42
    def query(sql, opts={})
      if ::EM.reactor_running?
        super(sql, opts.merge(:async => true))
        deferable = ::EM::DefaultDeferrable.new
        @watch = ::EM.watch(self.socket, Watcher, self, deferable)
        @watch.notify_readable = true
        deferable
      else
        super(sql, opts)
      end
    end