module Mysql2::Fibered::Client::Watcher

Public Class Methods

new(client, deferable) click to toggle source
# File lib/active_record/connection_adapters/em_mysql2_adapter.rb, line 26
def initialize(client, deferable)
  @client = client
  @deferable = deferable
end

Public Instance Methods

notify_readable() click to toggle source
# File lib/active_record/connection_adapters/em_mysql2_adapter.rb, line 31
def notify_readable
  begin
    detach
    results = @client.async_result
    @deferable.succeed(results)
  rescue Exception => e
    @deferable.fail(e)
  end
end