ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-DBus/DBus.pm
(Generate patch)

Comparing AnyEvent-DBus/DBus.pm (file contents):
Revision 1.3 by root, Mon Jun 21 00:11:55 2010 UTC vs.
Revision 1.5 by root, Mon Jun 21 10:24:44 2010 UTC

1=head1 NAME 1=head1 NAME
2 2
3AnyEvent::AIO - truly asynchronous file and directory I/O 3AnyEvent::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
13This module is an L<AnyEvent> user, you need to make sure that you use and 24This module is an L<AnyEvent> user, you need to make sure that you use and
14run a supported event loop. 25run a supported event loop.
78 89
79use AnyEvent (); 90use AnyEvent ();
80use Net::DBus (); 91use Net::DBus ();
81use Net::DBus::Binding::Watch (); 92use Net::DBus::Binding::Watch ();
82 93
83our $VERSION = '0.1'; 94our $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
145} 156}
146 157
147sub manage { 158sub manage {
148 my (undef, $con) = @_; 159 my (undef, $con) = @_;
149 160
150 $con->set_watch_callbacks (\&io_on, \&watch_off, \&io_toggle) 161 $con->set_watch_callbacks (\&io_on, \&watch_off, \&io_toggle);
151 if $con->can ("set_watch_callbacks"); 162# if $con->can ("set_watch_callbacks");
152 163
153 $con->set_timeout_callbacks (\&timeout_on, \&watch_off, \&timeout_toggle) 164 $con->set_timeout_callbacks (\&timeout_on, \&watch_off, \&timeout_toggle);
154 if $con->can ("set_timeout_callbacks"); 165# if $con->can ("set_timeout_callbacks");
155} 166}
156 167
157=head1 SEE ALSO 168=head1 SEE ALSO
158 169
159L<AnyEvent>, L<Net::DBus>. 170L<AnyEvent>, L<Net::DBus>.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines