Class: LIBUSB::DevHandle::EMTransfer

Inherits:
Object
  • Object
show all
Includes:
EM::Deferrable
Defined in:
lib/libusb/eventmachine.rb

Instance Method Summary collapse

Constructor Details

#initialize(opts, dev_handle, transfer_method) ⇒ EMTransfer

Returns a new instance of EMTransfer.


120
121
122
123
124
125
126
127
128
129
130
# File 'lib/libusb/eventmachine.rb', line 120

def initialize(opts, dev_handle, transfer_method)
  dev_handle.send(transfer_method, opts) do |res|
    EM.next_tick do
      if res.kind_of?(LIBUSB::Error)
        fail res
      else
        succeed res
      end
    end
  end
end