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.365 by root, Tue Aug 16 14:47:26 2011 UTC vs.
Revision 1.369 by root, Wed Aug 17 02:32:01 2011 UTC

1=head1 NAME 1=head1 NAME
2 2
3AnyEvent - the DBI of event loop programming 3AnyEvent - the DBI of event loop programming
4 4
5EV, Event, Glib, Tk, Perl, Event::Lib, Irssi, rxvt-unicode, IO::Async, Qt 5EV, Event, Glib, Tk, Perl, Event::Lib, Irssi, rxvt-unicode, IO::Async, Qt,
6and POE are various supported event loops/environments. 6FLTK and POE are various supported event loops/environments.
7 7
8=head1 SYNOPSIS 8=head1 SYNOPSIS
9 9
10 use AnyEvent; 10 use AnyEvent;
11 11
1056Log the given C<$msg> at the given C<$level>. 1056Log the given C<$msg> at the given C<$level>.
1057 1057
1058Loads AnyEvent::Log on first use and calls C<AnyEvent::Log::log> - 1058Loads AnyEvent::Log on first use and calls C<AnyEvent::Log::log> -
1059consequently, look at the L<AnyEvent::Log> documentation for details. 1059consequently, look at the L<AnyEvent::Log> documentation for details.
1060 1060
1061If you want to sprinkle loads of logging calls around your code, consider
1062creating a logger callback with the C<AnyEvent::Log::logger< function.
1063
1061=back 1064=back
1062 1065
1063=head1 WHAT TO DO IN A MODULE 1066=head1 WHAT TO DO IN A MODULE
1064 1067
1065As a module author, you should C<use AnyEvent> and call AnyEvent methods 1068As a module author, you should C<use AnyEvent> and call AnyEvent methods
1121 1124
1122 1125
1123=head1 OTHER MODULES 1126=head1 OTHER MODULES
1124 1127
1125The following is a non-exhaustive list of additional modules that use 1128The following is a non-exhaustive list of additional modules that use
1126AnyEvent as a client and can therefore be mixed easily with other AnyEvent 1129AnyEvent as a client and can therefore be mixed easily with other
1127modules and other event loops in the same program. Some of the modules 1130AnyEvent modules and other event loops in the same program. Some of the
1128come as part of AnyEvent, the others are available via CPAN. 1131modules come as part of AnyEvent, the others are available via CPAN (see
1132L<http://search.cpan.org/search?m=module&q=anyevent%3A%3A*> for
1133a longer non-exhaustive list), and the list is heavily biased towards
1134modules of the AnyEvent author himself :)
1129 1135
1130=over 4 1136=over 4
1131 1137
1132=item L<AnyEvent::Util> 1138=item L<AnyEvent::Util>
1133 1139
1408 if defined &{"$MODEL\::$_"}; 1414 if defined &{"$MODEL\::$_"};
1409 } 1415 }
1410 1416
1411 _isa_set; 1417 _isa_set;
1412 1418
1419 # we're officially open!
1420
1413 if ($ENV{PERL_ANYEVENT_STRICT}) { 1421 if ($ENV{PERL_ANYEVENT_STRICT}) {
1414 require AnyEvent::Strict; 1422 require AnyEvent::Strict;
1415 } 1423 }
1416 1424
1417 if ($ENV{PERL_ANYEVENT_DEBUG_WRAP}) { 1425 if ($ENV{PERL_ANYEVENT_DEBUG_WRAP}) {
1418 require AnyEvent::Debug; 1426 require AnyEvent::Debug;
1419 AnyEvent::Debug::wrap ($ENV{PERL_ANYEVENT_DEBUG_WRAP}); 1427 AnyEvent::Debug::wrap ($ENV{PERL_ANYEVENT_DEBUG_WRAP});
1420 } 1428 }
1421 1429
1422 if (exists $ENV{PERL_ANYEVENT_DEBUG_SHELL}) { 1430 if (length $ENV{PERL_ANYEVENT_DEBUG_SHELL}) {
1423 require AnyEvent::Socket; 1431 require AnyEvent::Socket;
1424 require AnyEvent::Debug; 1432 require AnyEvent::Debug;
1425 1433
1426 my $shell = $ENV{PERL_ANYEVENT_DEBUG_SHELL}; 1434 my $shell = $ENV{PERL_ANYEVENT_DEBUG_SHELL};
1427 $shell =~ s/\$\$/$$/g; 1435 $shell =~ s/\$\$/$$/g;
1428 1436
1429 my ($host, $service) = AnyEvent::Socket::parse_hostport ($shell); 1437 my ($host, $service) = AnyEvent::Socket::parse_hostport ($shell);
1430 $AnyEvent::Debug::SHELL = AnyEvent::Debug::shell ($host, $service); 1438 $AnyEvent::Debug::SHELL = AnyEvent::Debug::shell ($host, $service);
1431 } 1439 }
1440
1441 # now the anyevent environment is set up as the user told us to, so
1442 # call the actual user code - post detects
1432 1443
1433 (shift @post_detect)->() while @post_detect; 1444 (shift @post_detect)->() while @post_detect;
1434 undef @post_detect; 1445 undef @post_detect;
1435 1446
1436 *post_detect = sub(&) { 1447 *post_detect = sub(&) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines