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.423 by root, Sat May 2 14:39:31 2015 UTC vs.
Revision 1.424 by root, Tue Jun 16 03:22:20 2015 UTC

1078If you want to sprinkle loads of logging calls around your code, consider 1078If you want to sprinkle loads of logging calls around your code, consider
1079creating a logger callback with the C<AnyEvent::Log::logger> function, 1079creating a logger callback with the C<AnyEvent::Log::logger> function,
1080which can reduce typing, codesize and can reduce the logging overhead 1080which can reduce typing, codesize and can reduce the logging overhead
1081enourmously. 1081enourmously.
1082 1082
1083=item AnyEvent::fh_block $filehandle
1084
1085=item AnyEvent::fh_unblock $filehandle
1086
1087Sets blocking or non-blocking behaviour for the given filehandle.
1088
1083=back 1089=back
1084 1090
1085=head1 WHAT TO DO IN A MODULE 1091=head1 WHAT TO DO IN A MODULE
1086 1092
1087As a module author, you should C<use AnyEvent> and call AnyEvent methods 1093As a module author, you should C<use AnyEvent> and call AnyEvent methods
1353# } 1359# }
1354} 1360}
1355 1361
1356if (length $ENV{PERL_ANYEVENT_LOG}) { 1362if (length $ENV{PERL_ANYEVENT_LOG}) {
1357 require AnyEvent::Log; # AnyEvent::Log does the thing for us 1363 require AnyEvent::Log; # AnyEvent::Log does the thing for us
1364}
1365
1366BEGIN {
1367 *_fh_nonblocking = AnyEvent::WIN32
1368 ? sub($$) {
1369 ioctl $_[0], 0x8004667e, pack "L", $_[1]; # FIONBIO
1370 }
1371 : sub($$) {
1372 fcntl $_[0], AnyEvent::F_SETFL, $_[1] ? AnyEvent::O_NONBLOCK : 0;
1373 }
1374 ;
1375}
1376
1377sub fh_block($) {
1378 _fh_nonblocking shift, 0
1379}
1380
1381sub fh_unblock($) {
1382 _fh_nonblocking shift, 1
1358} 1383}
1359 1384
1360our @models = ( 1385our @models = (
1361 [EV:: => AnyEvent::Impl::EV::], 1386 [EV:: => AnyEvent::Impl::EV::],
1362 [AnyEvent::Loop:: => AnyEvent::Impl::Perl::], 1387 [AnyEvent::Loop:: => AnyEvent::Impl::Perl::],

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines