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

Defined in:
lib/mysql2/em.rb

Instance Method Summary collapse

Instance Method Details

#initialize(client, deferable) ⇒ Object



10
11
12
13
# File 'lib/mysql2/em.rb', line 10

def initialize(client, deferable)
  @client = client
  @deferable = deferable
end

#notify_readableObject



15
16
17
18
19
20
21
22
# File 'lib/mysql2/em.rb', line 15

def notify_readable
  detach
  begin
    @deferable.succeed(@client.async_result)
  rescue Exception => e
    @deferable.fail(e)
  end
end