… | |
… | |
878 | AnyEvent::Impl::EventLib based on Event::Lib, leaks memory and worse. |
878 | AnyEvent::Impl::EventLib based on Event::Lib, leaks memory and worse. |
879 | AnyEvent::Impl::POE based on POE, very slow, some limitations. |
879 | AnyEvent::Impl::POE based on POE, very slow, some limitations. |
880 | AnyEvent::Impl::Irssi used when running within irssi. |
880 | AnyEvent::Impl::Irssi used when running within irssi. |
881 | AnyEvent::Impl::IOAsync based on IO::Async. |
881 | AnyEvent::Impl::IOAsync based on IO::Async. |
882 | AnyEvent::Impl::Cocoa based on Cocoa::EventLoop. |
882 | AnyEvent::Impl::Cocoa based on Cocoa::EventLoop. |
883 | AnyEvent::Impl::FLTK2 based on FLTK (fltk 2 binding). |
883 | AnyEvent::Impl::FLTK based on FLTK (fltk 2 binding). |
884 | |
884 | |
885 | =item Backends with special needs. |
885 | =item Backends with special needs. |
886 | |
886 | |
887 | Qt requires the Qt::Application to be instantiated first, but will |
887 | Qt requires the Qt::Application to be instantiated first, but will |
888 | otherwise be picked up automatically. As long as the main program |
888 | otherwise be picked up automatically. As long as the main program |
… | |
… | |
1166 | |
1166 | |
1167 | Implement event-based interfaces to the protocols of the same name (for |
1167 | Implement event-based interfaces to the protocols of the same name (for |
1168 | the curious, IGS is the International Go Server and FCP is the Freenet |
1168 | the curious, IGS is the International Go Server and FCP is the Freenet |
1169 | Client Protocol). |
1169 | Client Protocol). |
1170 | |
1170 | |
1171 | =item L<AnyEvent::Handle::UDP> |
|
|
1172 | |
|
|
1173 | Here be danger! |
|
|
1174 | |
|
|
1175 | As Pauli would put it, "Not only is it not right, it's not even wrong!" - |
|
|
1176 | there are so many things wrong with AnyEvent::Handle::UDP, most notably |
|
|
1177 | its use of a stream-based API with a protocol that isn't streamable, that |
|
|
1178 | the only way to improve it is to delete it. |
|
|
1179 | |
|
|
1180 | It features data corruption (but typically only under load) and general |
|
|
1181 | confusion. On top, the author is not only clueless about UDP but also |
|
|
1182 | fact-resistant - some gems of his understanding: "connect doesn't work |
|
|
1183 | with UDP", "UDP packets are not IP packets", "UDP only has datagrams, not |
|
|
1184 | packets", "I don't need to implement proper error checking as UDP doesn't |
|
|
1185 | support error checking" and so on - he doesn't even understand what's |
|
|
1186 | wrong with his module when it is explained to him. |
|
|
1187 | |
|
|
1188 | =item L<AnyEvent::DBI> |
|
|
1189 | |
|
|
1190 | Executes L<DBI> requests asynchronously in a proxy process for you, |
|
|
1191 | notifying you in an event-based way when the operation is finished. |
|
|
1192 | |
|
|
1193 | =item L<AnyEvent::AIO> |
1171 | =item L<AnyEvent::AIO> |
1194 | |
1172 | |
1195 | Truly asynchronous (as opposed to non-blocking) I/O, should be in the |
1173 | Truly asynchronous (as opposed to non-blocking) I/O, should be in the |
1196 | toolbox of every event programmer. AnyEvent::AIO transparently fuses |
1174 | toolbox of every event programmer. AnyEvent::AIO transparently fuses |
1197 | L<IO::AIO> and AnyEvent together, giving AnyEvent access to event-based |
1175 | L<IO::AIO> and AnyEvent together, giving AnyEvent access to event-based |
1198 | file I/O, and much more. |
1176 | file I/O, and much more. |
1199 | |
1177 | |
|
|
1178 | =item L<AnyEvent::Filesys::Notify> |
|
|
1179 | |
|
|
1180 | AnyEvent is good for non-blocking stuff, but it can't detect file or |
|
|
1181 | path changes (e.g. "watch this directory for new files", "watch this |
|
|
1182 | file for changes"). The L<AnyEvent::Filesys::Notify> module promises to |
|
|
1183 | do just that in a portbale fashion, supporting inotify on GNU/Linux and |
|
|
1184 | some weird, without doubt broken, stuff on OS X to monitor files. It can |
|
|
1185 | fall back to blocking scans at regular intervals transparently on other |
|
|
1186 | platforms, so it's about as portable as it gets. |
|
|
1187 | |
|
|
1188 | (I haven't used it myself, but I haven't heard anybody complaining about |
|
|
1189 | it yet). |
|
|
1190 | |
|
|
1191 | =item L<AnyEvent::DBI> |
|
|
1192 | |
|
|
1193 | Executes L<DBI> requests asynchronously in a proxy process for you, |
|
|
1194 | notifying you in an event-based way when the operation is finished. |
|
|
1195 | |
1200 | =item L<AnyEvent::HTTPD> |
1196 | =item L<AnyEvent::HTTPD> |
1201 | |
1197 | |
1202 | A simple embedded webserver. |
1198 | A simple embedded webserver. |
1203 | |
1199 | |
1204 | =item L<AnyEvent::FastPing> |
1200 | =item L<AnyEvent::FastPing> |
1205 | |
1201 | |
1206 | The fastest ping in the west. |
1202 | The fastest ping in the west. |
1207 | |
1203 | |
1208 | =item L<Coro> |
1204 | =item L<Coro> |
1209 | |
1205 | |
1210 | Has special support for AnyEvent via L<Coro::AnyEvent>. |
1206 | Has special support for AnyEvent via L<Coro::AnyEvent>, which allows you |
|
|
1207 | to simply invert the flow control - don't call us, we will call you: |
|
|
1208 | |
|
|
1209 | async { |
|
|
1210 | Coro::AnyEvent::sleep 5; # creates a 5s timer and waits for it |
|
|
1211 | print "5 seconds later!\n"; |
|
|
1212 | |
|
|
1213 | Coro::AnyEvent::readable *STDIN; # uses an I/O watcher |
|
|
1214 | my $line = <STDIN>; # works for ttys |
|
|
1215 | |
|
|
1216 | AnyEvent::HTTP::http_get "url", Coro::rouse_cb; |
|
|
1217 | my ($body, $hdr) = Coro::rouse_wait; |
|
|
1218 | }; |
1211 | |
1219 | |
1212 | =back |
1220 | =back |
1213 | |
1221 | |
1214 | =cut |
1222 | =cut |
1215 | |
1223 | |
… | |
… | |
1225 | |
1233 | |
1226 | BEGIN { AnyEvent::common_sense } |
1234 | BEGIN { AnyEvent::common_sense } |
1227 | |
1235 | |
1228 | use Carp (); |
1236 | use Carp (); |
1229 | |
1237 | |
1230 | our $VERSION = '6.01'; |
1238 | our $VERSION = '6.02'; |
1231 | our $MODEL; |
1239 | our $MODEL; |
1232 | |
1240 | |
1233 | our @ISA; |
1241 | our @ISA; |
1234 | |
1242 | |
1235 | our @REGISTRY; |
1243 | our @REGISTRY; |
… | |
… | |
1328 | [POE::Kernel:: => AnyEvent::Impl::POE::], # lasciate ogni speranza |
1336 | [POE::Kernel:: => AnyEvent::Impl::POE::], # lasciate ogni speranza |
1329 | [Wx:: => AnyEvent::Impl::POE::], |
1337 | [Wx:: => AnyEvent::Impl::POE::], |
1330 | [Prima:: => AnyEvent::Impl::POE::], |
1338 | [Prima:: => AnyEvent::Impl::POE::], |
1331 | [IO::Async::Loop:: => AnyEvent::Impl::IOAsync::], # a bitch to autodetect |
1339 | [IO::Async::Loop:: => AnyEvent::Impl::IOAsync::], # a bitch to autodetect |
1332 | [Cocoa::EventLoop:: => AnyEvent::Impl::Cocoa::], |
1340 | [Cocoa::EventLoop:: => AnyEvent::Impl::Cocoa::], |
1333 | [FLTK:: => AnyEvent::Impl::FLTK2::], |
1341 | [FLTK:: => AnyEvent::Impl::FLTK::], |
1334 | ); |
1342 | ); |
1335 | |
1343 | |
1336 | our @isa_hook; |
1344 | our @isa_hook; |
1337 | |
1345 | |
1338 | sub _isa_set { |
1346 | sub _isa_set { |