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.



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

def initialize
  @callbacks = []
  super
end

Instance Method Details

#need_handle_eventsObject Also known as: notify_readable, notify_writable



86
87
88
89
90
# File 'lib/libusb/eventmachine.rb', line 86

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

#on_need_handle_events(&block) ⇒ Object



82
83
84
# File 'lib/libusb/eventmachine.rb', line 82

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