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.



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

def initialize
  @callbacks = []
  super
end

Instance Method Details

#need_handle_eventsObject Also known as: notify_readable, notify_writable



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

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

#on_need_handle_events(&block) ⇒ Object



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

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