Class: Mysql2::EM::Client

### Home Classes Methods

### In Files

- lib/mysql2/em.rb

### Parent

Mysql2::Client

### Namespace

- MODULE Mysql2::EM::Client::Watcher

### Methods

- #close
- #query

### Class/Module Index

Quicksearch

- Mysql2
- Mysql2::Client
- Mysql2::EM
- Mysql2::EM::Client
- Mysql2::EM::Client::Watcher
- Mysql2::Error
- Mysql2::Result
- Mysql2::Util
- Object

No matching classes.

# Mysql2::EM::Client

### Public Instance Methods

close(*args) click to toggle source

    # 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

    # 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

[Validate]

Generated with the Darkfish Rdoc Generator 2.