Class: LibvirtAsync::Handle::Monitor

Inherits:
Async::Wrapper
  • Object
show all
Defined in:
lib/libvirt_async/handle.rb

Overview

Represents an event handle (usually a file descriptor). When an event happens to the handle, we dispatch the event to libvirt via Libvirt::Event.invoke_handle_callback (feeding it the handle_id we returned from add_handle, the file descriptor, the new events, and the opaque data that libvirt gave us earlier).

Instance Method Summary collapse

Instance Method Details

#closeObject



12
13
14
# File 'lib/libvirt_async/handle.rb', line 12

def close
  cancel_monitor
end

#inspectObject



24
25
26
# File 'lib/libvirt_async/handle.rb', line 24

def inspect
  to_s
end

#readinessObject



16
17
18
# File 'lib/libvirt_async/handle.rb', line 16

def readiness
  monitor&.readiness
end

#to_sObject



20
21
22
# File 'lib/libvirt_async/handle.rb', line 20

def to_s
  "#<#{self.class}:0x#{object_id.to_s(16)} readable=#{@readable&.object_id&.to_s(16)} writable=#{@writable&.object_id&.to_s(16)} alive=#{@monitor && !@monitor.closed?}>"
end