NAME
Protocol::DBus::Client::IOAsync - D-Bus with IO::Async
SYNOPSIS
The following creates a D-Bus connection, sends two messages, waits for their responses, then ends:
use experimental 'signatures';
my $loop = IO::Async::Loop->new();
my $dbus = Protocol::DBus::Client::IOAsync::system($loop)
$dbus->initialize()->then(
sub ($dbus) {
my $a = $dbus->send_call( .. )->then( sub ($resp) {
# ..
} );
my $b = $dbus->send_call( .. )->then( sub ($resp) {
# ..
} );
return Promise::ES6->all( [$a, $b] );
},
)->finally( sub { $loop->stop() } );
$loop->run();
DESCRIPTION
This module provides an IO::Async interface on top of Protocol::DBus::Client. It subclasses Protocol::DBus::Client::EventBase.
STATIC FUNCTIONS
This module offers system()
and login_session()
functions that offer similar functionality to their analogues in Protocol::DBus::Client, but they return instances of this class.
Additionally, both functions require an IO::Async::Loop to be passed.