NAME
Protocol::DBus::Client::Mojo - D-Bus with Mojolicious
SYNOPSIS
use experimental 'signatures';
my $dbus = Protocol::DBus::Client::Mojo::system();
$dbus->initialize_p()->then(
sub ($msgr) {
my $a = $msgr->send_call_p( .. )->then( sub ($resp) {
# ..
} );
my $b = $msgr->send_call_p( .. )->then( sub ($resp) {
# ..
} );
return Mojo::Promise->all( $a, $b );
},
)->wait();
DESCRIPTION
This module provides an interface between Mojo::IOLoop and Protocol::DBus::Client. It subclasses Protocol::DBus::Client::EventBase.
Mojolicious-based applications can use this module to interface easily with D-Bus.
INTERFACE NOTES
This module exposes mostly the same interface as Protocol::DBus::Client::AnyEvent, except for a bit of “Mojo-specific” behavior:
Returned promises, both from
initialize()
and the messenger object’ssend_call()
, are instances of Mojo::Promise rather than Promise::ES6.initialize_p()
andsend_call_p()
exist as aliases forinitialize()
andsend_call()
, respectively.
INTERFACE
This module’s interface is identical to that of Protocol::DBus::Client::AnyEvent. See that module for more details.