Class: LIBUSB::Context::EMPollfdHandler

Inherits:
EventMachine::Connection
  • Object
show all
Defined in:
lib/libusb/eventmachine.rb

Instance Method Summary collapse

Constructor Details

#initializeEMPollfdHandler

Returns a new instance of EMPollfdHandler.


68
69
70
71
# File 'lib/libusb/eventmachine.rb', line 68

def initialize
  @callbacks = []
  super
end

Instance Method Details

#need_handle_eventsObject Also known as: notify_readable, notify_writable


77
78
79
80
81
# File 'lib/libusb/eventmachine.rb', line 77

def need_handle_events
  @callbacks.each do |cb|
    cb.call
  end
end

#on_need_handle_events(&block) ⇒ Object


73
74
75
# File 'lib/libusb/eventmachine.rb', line 73

def on_need_handle_events(&block)
  @callbacks << block
end