Sys::Virt::Event(3pm)
πΈ NAME πΈ
Sys::Virt::Event β Event loop access β¨
okay so this is Sys::Virt::Event(3pm), from the User Contributed Perl Documentation, and it is literally all about event loop access, bestie. π
π DESCRIPTION π
The Sys::Virt::Event 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. No cap: it is the blueprint, not the whole build. π«Ά
β οΈ DEPRECATED FUNCTIONALITY β οΈ
okay so this is the important glow-up tea: event loop implementations used to be required to be instances of sub-classes of Sys::Virt::Event. Instead, they are now required to inherit from Sys::Virt::EventImpl. For backward compatibility with versions 9.4 and older, inheriting from Sys::Virt::Event is still supported, but will be removed mid 2025. β³β οΈ
the old inheritance path is only there for backward compatibility, and the original says it will be removed mid 2025. So like... heads up. π
π οΈ METHODS π οΈ
register_default()β Register the default libvirt event loop implementation.run_default()β Run a single iteration of the default event loop implementation.register($impl)β Register an event loop implementation. The implementation should be an instance of a sub-class of theSys::Virt::EventImplpackage. See the section"EVENT LOOP IMPLEMENTATION"below for more information. πmy $watch = Sys::Virt::Event::add_handle($fd, $events, $coderef)β Adds a watch on the file descriptor$fdfor the events$events, which is a mask of theFILE HANDLE EVENTSconstants listed later. The$coderefparameter is a subroutine to invoke when an event is triggered. The subroutine will be passed three parameters: the watch identifier, the file descriptor, and the event mask. This method returns the watch identifier, which can be used to update or remove the watch. πSys::Virt::Event::update_handle($watch, $events)β Update the event mask for the file descriptor watch$watchto use the events$events.Sys::Virt::Event::remove_handle($watch)β Remove the event mask for the file descriptor watch$watch.my $timer = Sys::Virt::Event::add_timeout($frequency, $coderef, $opaque)β Adds a timeout to trigger with$frequencymilliseconds interval. The$coderefparameter is a subroutine to invoke when an event is triggered. The subroutine will be passed one parameter, the timer identifier. This method returns the timer identifier, which can be used to update or remove the timer. β°Sys::Virt::Event::update_timeout($timer, $frequency)β Update the timeout$timerto have the frequency$frequencymilliseconds. The values0and-1have special meaning. The value0wants the callback to be invoked on each event loop iteration, where-1stops the callback from being invoked. π¦Sys::Virt::Event::remove_timeout($timer)β Remove the timeout$timer.
π’ CONSTANTS π’
π FILE HANDLE EVENTS π
When integrating with an event loop, the following constants define the file descriptor events: π
Sys::Virt::Event::HANDLE_READABLEβ The file descriptor has data available for read without blocking.Sys::Virt::Event::HANDLE_WRITABLEβ The file descriptor has ability to write data without blocking.Sys::Virt::Event::HANDLE_ERRORβ An error occurred on the file descriptor.Sys::Virt::Event::HANDLE_HANGUPβ The remote end of the file descriptor closed.
π AUTHORS π
Daniel P. Berrange <berrange@redhat.com>π
Β©οΈ COPYRIGHT Β©οΈ
Copyright (C) 2006-2009 Red HatCopyright (C) 2006-2009 Daniel P. Berrange
π LICENSE π
okay so the legal bit, bestie:
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.
π SEE ALSO π
Sys::Virt"http://libvirt.org"
okay bye bestie! this was Sys::Virt::Event(3pm) from perl v5.40.2, dated 2026-06-08 πβ¨
π¦ where this page comes from
- epel 10: perl-Sys-Virt 12.4.0-1.el10_3 Β· GPL-2.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms