module Mysql2::EM::Client::Watcher - mysql2-0.4.9 Documentation

# module Mysql2::EM::Client::Watcher

### Public Class Methods

new(client, deferable) click to toggle source

    # File lib/mysql2/em.rb, line 9
    def initialize(client, deferable)
      @client = client
      @deferable = deferable
      @is_watching = true
    end

### Public Instance Methods

notify_readable() click to toggle source

    # File lib/mysql2/em.rb, line 15
    def notify_readable
      detach
      begin
        result = @client.async_result
      rescue => e
        @deferable.fail(e)
      else
        @deferable.succeed(result)
      end
    end

unbind() click to toggle source

    # File lib/mysql2/em.rb, line 30
    def unbind
      @is_watching = false
    end

watching?() click to toggle source

    # File lib/mysql2/em.rb, line 26
    def watching?
      @is_watching
    end