NAME
Sys::Async::Virt::Connection - Connection to LibVirt server (abstract base class)
VERSION
v0.0.13
SYNOPSIS
use v5.26;
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.
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.