Protocol::DBus::Client::IOAsync - D-Bus with IO::Async
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();
This module provides an IO::Async interface on top of Protocol::DBus::Client. It subclasses Protocol::DBus::Client::EventBase.
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.
system()
login_session()
Additionally, both functions require an IO::Async::Loop to be passed.
To install Protocol::DBus, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Protocol::DBus
CPAN shell
perl -MCPAN -e shell install Protocol::DBus
For more information on module installation, please visit the detailed CPAN module installation guide.