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.5 by root, Mon Jun 21 10:24:44 2010 UTC vs.
Revision 1.6 by root, Mon Jun 21 19:43:42 2010 UTC

116 116
117 $f & Net::DBus::Binding::Watch::READABLE () 117 $f & Net::DBus::Binding::Watch::READABLE ()
118 and 118 and
119 $O{$id}[0] = $on && AE::io $fd, 0, sub { 119 $O{$id}[0] = $on && AE::io $fd, 0, sub {
120 $w->handle (Net::DBus::Binding::Watch::READABLE ()); 120 $w->handle (Net::DBus::Binding::Watch::READABLE ());
121 $con->dispatch; # wtf., we tell it data is ready, but have to call dispatch ourselves??? 121 $con->dispatch;
122 }; 122 };
123 123
124 $f & Net::DBus::Binding::Watch::WRITABLE () 124 $f & Net::DBus::Binding::Watch::WRITABLE ()
125 and 125 and
126 $O{$id}[1] = $on && AE::io $fd, 1, sub { 126 $O{$id}[1] = $on && AE::io $fd, 1, sub {
127 $w->handle (Net::DBus::Binding::Watch::WRITABLE ()); 127 $w->handle (Net::DBus::Binding::Watch::WRITABLE ());
128 # calling flush, as NEt::DBus::Reactor does, is blocking :/ 128 $con->dispatch;
129 }; 129 };
130} 130}
131 131
132sub io_on { 132sub io_on {
133 my ($con, $w) = @_; 133 my ($con, $w) = @_;
142 my ($con, $w) = @_; 142 my ($con, $w) = @_;
143 143
144 my $id = $w->get_data; 144 my $id = $w->get_data;
145 my $i = $w->get_interval * 0.001; 145 my $i = $w->get_interval * 0.001;
146 146
147 $O{$id} = $w->is_enabled && AE::timer $i, $i, sub { $w->handle }; 147 $O{$id} = $w->is_enabled && AE::timer $i, $i, sub {
148 $w->handle;
149 $con->dispatch;
150 };
148} 151}
149 152
150sub timeout_on { 153sub timeout_on {
151 my ($con, $w) = @_; 154 my ($con, $w) = @_;
152 my $id = ++$I; 155 my $id = ++$I;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines