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



10
11
12
# File 'lib/libvirt_async/handle.rb', line 10

def close
  cancel_monitor
end

#inspectObject



22
23
24
# File 'lib/libvirt_async/handle.rb', line 22

def inspect
  to_s
end

#readinessObject



14
15
16
# File 'lib/libvirt_async/handle.rb', line 14

def readiness
  monitor&.readiness
end

#to_sObject



18
19
20
# File 'lib/libvirt_async/handle.rb', line 18

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 && [email protected]?}>"
end