1 | =head1 NAME |
1 | =head1 NAME |
2 | |
2 | |
3 | AnyEvent::AIO - truly asynchronous file and directory I/O |
3 | AnyEvent::DBus - adapt Net::DBus to AnyEvent |
4 | |
4 | |
5 | =head1 SYNOPSIS |
5 | =head1 SYNOPSIS |
6 | |
6 | |
7 | use AnyEvent::DBus; |
7 | use AnyEvent::DBus; |
8 | |
8 | |
9 | # now use the Net::DBus API, preferably the non-blocking variants |
9 | # now use the Net::DBus API, preferably the non-blocking variants: |
|
|
10 | |
|
|
11 | use Net::DBus::Annotation qw(:call); |
|
|
12 | |
|
|
13 | $bus->get_object (...) |
|
|
14 | ->Method (dbus_call_async, $arg1, ...) |
|
|
15 | ->set_notify (sub { |
|
|
16 | my @data = $_[0]->get_result |
|
|
17 | ... |
|
|
18 | }); |
|
|
19 | |
|
|
20 | $bus->get_connection->send (...); |
10 | |
21 | |
11 | =head1 DESCRIPTION |
22 | =head1 DESCRIPTION |
12 | |
23 | |
13 | This module is an L<AnyEvent> user, you need to make sure that you use and |
24 | This module is an L<AnyEvent> user, you need to make sure that you use and |
14 | run a supported event loop. |
25 | run a supported event loop. |
… | |
… | |
78 | |
89 | |
79 | use AnyEvent (); |
90 | use AnyEvent (); |
80 | use Net::DBus (); |
91 | use Net::DBus (); |
81 | use Net::DBus::Binding::Watch (); |
92 | use Net::DBus::Binding::Watch (); |
82 | |
93 | |
83 | our $VERSION = '0.1'; |
94 | our $VERSION = '0.3'; |
84 | |
95 | |
85 | # yup, Net::DBus checks by using exists on %INC... |
96 | # yup, Net::DBus checks by using exists on %INC... |
86 | $INC{'Net/DBus/Reactor.pm'} = undef; |
97 | $INC{'Net/DBus/Reactor.pm'} = undef; |
87 | |
98 | |
88 | # claim we are the main reactor mainloop |
99 | # claim we are the main reactor mainloop |