Module: Mysql2::EM::Client::Watcher

### Home Classes Methods

### In Files

- lib/mysql2/em.rb

### Methods

- ::new
- #notify_readable
- #unbind
- #watching?

### 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::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 Exception => 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

[Validate]

Generated with the Darkfish Rdoc Generator 2.