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

Comparing AnyEvent/lib/AnyEvent.pm (file contents):
Revision 1.99 by root, Sun Apr 27 17:09:33 2008 UTC vs.
Revision 1.102 by root, Sun Apr 27 21:16:26 2008 UTC

65technically possible. 65technically possible.
66 66
67Of course, if you want lots of policy (this can arguably be somewhat 67Of course, if you want lots of policy (this can arguably be somewhat
68useful) and you want to force your users to use the one and only event 68useful) and you want to force your users to use the one and only event
69model, you should I<not> use this module. 69model, you should I<not> use this module.
70
71#TODO#
72
73Net::IRC3
74AnyEvent::HTTPD
75AnyEvent::DNS
76IO::AnyEvent
77Net::FPing
78Net::XMPP2
79Coro
80
81AnyEvent::IRC
82AnyEvent::HTTPD
83AnyEvent::DNS
84AnyEvent::Handle
85AnyEvent::Socket
86AnyEvent::FPing
87AnyEvent::XMPP
88AnyEvent::SNMP
89Coro
90 70
91=head1 DESCRIPTION 71=head1 DESCRIPTION
92 72
93L<AnyEvent> provides an identical interface to multiple event loops. This 73L<AnyEvent> provides an identical interface to multiple event loops. This
94allows module authors to utilise an event loop without forcing module 74allows module authors to utilise an event loop without forcing module
476might chose the wrong one unless you load the correct one yourself. 456might chose the wrong one unless you load the correct one yourself.
477 457
478You can chose to use a rather inefficient pure-perl implementation by 458You can chose to use a rather inefficient pure-perl implementation by
479loading the C<AnyEvent::Impl::Perl> module, which gives you similar 459loading the C<AnyEvent::Impl::Perl> module, which gives you similar
480behaviour everywhere, but letting AnyEvent chose is generally better. 460behaviour everywhere, but letting AnyEvent chose is generally better.
461
462=head1 OTHER MODULES
463
464The following is a non-exhaustive list of additional modules that use
465AnyEvent and can therefore be mixed easily with other AnyEvent modules
466in the same program. Some of the modules come with AnyEvent, some are
467available via CPAN.
468
469=over 4
470
471=item L<AnyEvent::Util>
472
473Contains various utility functions that replace often-used but blocking
474functions such as C<inet_aton> by event-/callback-based versions.
475
476=item L<AnyEvent::Handle>
477
478Provide read and write buffers and manages watchers for reads and writes.
479
480=item L<AnyEvent::Socket>
481
482Provides a means to do non-blocking connects, accepts etc.
483
484=item L<AnyEvent::HTTPD>
485
486Provides a simple web application server framework.
487
488=item L<AnyEvent::DNS>
489
490Provides asynchronous DNS resolver capabilities, beyond what
491L<AnyEvent::Util> offers.
492
493=item L<AnyEvent::FastPing>
494
495The fastest ping in the west.
496
497=item L<Net::IRC3>
498
499AnyEvent based IRC client module family.
500
501=item L<Net::XMPP2>
502
503AnyEvent based XMPP (Jabber protocol) module family.
504
505=item L<Net::FCP>
506
507AnyEvent-based implementation of the Freenet Client Protocol, birthplace
508of AnyEvent.
509
510=item L<Event::ExecFlow>
511
512High level API for event-based execution flow control.
513
514=item L<Coro>
515
516Has special support for AnyEvent.
517
518=item L<IO::Lambda>
519
520The lambda approach to I/O - don't ask, look there. Can use AnyEvent.
521
522=item L<IO::AIO>
523
524Truly asynchronous I/O, should be in the toolbox of every event
525programmer. Can be trivially made to use AnyEvent.
526
527=item L<BDB>
528
529Truly asynchronous Berkeley DB access. Can be trivially made to use
530AnyEvent.
531
532=back
481 533
482=cut 534=cut
483 535
484package AnyEvent; 536package AnyEvent;
485 537
1158speed most when you have lots of watchers, not when you only have a few of 1210speed most when you have lots of watchers, not when you only have a few of
1159them). 1211them).
1160 1212
1161EV is again fastest. 1213EV is again fastest.
1162 1214
1163The C-based event loops Event and Glib come in second this time, as the 1215Perl again comes second. It is noticably faster than the C-based event
1164overhead of running an iteration is much smaller in C than in Perl (little 1216loops Event and Glib, although the difference is too small to really
1165code to execute in the inner loop, and perl's function calling overhead is 1217matter.
1166high, and updating all the data structures is costly).
1167
1168The pure perl event loop is much slower, but still competitive.
1169 1218
1170POE also performs much better in this case, but is is still far behind the 1219POE also performs much better in this case, but is is still far behind the
1171others. 1220others.
1172 1221
1173=head3 Summary 1222=head3 Summary

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines