Sys::Virt::EventImpl(3pm) | User Contributed Perl Documentation | Sys::Virt::EventImpl(3pm) |
Sys::Virt::EventImpl - Event loop implementation parent class
The "Sys::Virt::EventImpl" module represents the contract for integrating libvirt with an event loop. This package is abstract and intended to be subclassed to provide an actual implementation.
This module is new in 9.5.0. To use this module while also supporting pre-9.5.0 versions, could may consider the code below to set up inheritance.
package YourImpl; use strict; use warnings; BEGIN { if (require Sys::Virt::EventImpl) { eval "use parent 'Sys::Virt::EventImpl';"; } else { eval "use parent 'Sys::Virt::Event';"; } }
When implementing an event loop, the implementation must be a sub-class of the "Sys::Virt::EventImpl" class. It must override these functions:
Next to the events explicitly indicated by $events, "Sys::Virt::Event::HANDLE_ERROR" and "Sys::Virt::Event::HANDLE_HANGUP" should always trigger the callback.
Returns a positive integer $watch_id or -1 on error.
Returns 0 on success or -1 on failure.
IMPORTANT This should also make sure that "_free_callback_opaque" is called after this function has been executed: not doing so will prevent the connection from being garbage collected.
Returns 0 on success or -1 on failure.
IMPORTANT This should also make sure that "_free_callback_opaque" is called after this function has been executed: not doing so will prevent the connection from being garbage collected.
IMPORTANT This helper must be called outside of any callbacks; that is after the "remove_handle" or "remove_timeout" callbacks complete.
Daniel P. Berrange <berrange@redhat.com>
Copyright (C) 2006-2009 Red Hat Copyright (C) 2006-2009 Daniel P. Berrange
This program is free software; you can redistribute it and/or modify it under the terms of either the GNU General Public License as published by the Free Software Foundation (either version 2 of the License, or at your option any later version), or, the Artistic License, as specified in the Perl README file.
Sys::Virt, "http://libvirt.org"
2024-03-31 | perl v5.38.2 |