NAME
Sys::Async::Virt::Connection - Connection to LibVirt server (abstract base class)
VERSION
v0.0.6
SYNOPSIS
use v5.20;
use Future::AsyncAwait;
use Sys::Async::Virt::Connection::Factory;
my $factory = Sys::Async::Virt::Connection::Factory->new;
my $conn = $factory->create_connection( 'qemu:///system' );
DESCRIPTION
This module presents an abstract base class.
METHODS
connect
await $conn->connect;
Establishes a connection with the server indicated by the URL passed to the new
method.
Note that implementing classes must provide a new
method.
is_secure
my $bool = $self->is_secure;
Returns true
when the transport is considered secure. This default version returns false
, failing on the safe side.
read
my $data = await $conn->read( 'data', 42 );
my $fds = await $conn->read( 'fds', 2 );
Reads bytes or file descriptors from the connection, returning a string (when requested to read data) or a reference to an array of file descriptors (when requested to read file descriptors).
write
await $conn->write( 'data1', 'data2', ... );
await $conn->write( [ $fd1, $fd2, ... ] );
Writes data (passed as strings) and file descriptors (passed as arrays of descriptors) to the connection.
INTERNAL METHODS
_parse_url
my %components = $self->_parse_url($url);
Returns a list of key/value pairs, with the following keys:
base
hypervisor
password
query
transport
type
username
SEE ALSO
LICENSE AND COPYRIGHT
Copyright (C) 2024 Erik Huelsmann
All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.