… | |
… | |
21 | make a program more readable, despite the lack of named parameters. |
21 | make a program more readable, despite the lack of named parameters. |
22 | Function calls also allow more static type checking than method calls, so |
22 | Function calls also allow more static type checking than method calls, so |
23 | many mistakes are caught at compiletime with this API. |
23 | many mistakes are caught at compiletime with this API. |
24 | |
24 | |
25 | Also, some backends (Perl and EV) are so fast that the method call |
25 | Also, some backends (Perl and EV) are so fast that the method call |
26 | overhead is very noticable (with EV it increases the time five- to |
26 | overhead is very noticeable (with EV it increases the time five- to |
27 | six-fold, with Perl the method call overhead is about a factor of two). |
27 | six-fold, with Perl the method call overhead is about a factor of two). |
28 | |
28 | |
29 | At the moment, there will be no checking (L<AnyEvent::Strict> does not |
29 | At the moment, there will be no checking (L<AnyEvent::Strict> does not |
30 | affect his API), so the L<AnyEvent> API has a definite advantage here |
30 | affect his API), so the L<AnyEvent> API has a definite advantage here |
31 | still. |
31 | still. |
… | |
… | |
50 | =cut |
50 | =cut |
51 | |
51 | |
52 | package AE; |
52 | package AE; |
53 | |
53 | |
54 | use AnyEvent (); # BEGIN { AnyEvent::common_sense } |
54 | use AnyEvent (); # BEGIN { AnyEvent::common_sense } |
|
|
55 | |
|
|
56 | our $VERSION = $AnyEvent::VERSION; |
55 | |
57 | |
56 | =item $w = AE::io $fh_or_fd, $watch_write, $cb |
58 | =item $w = AE::io $fh_or_fd, $watch_write, $cb |
57 | |
59 | |
58 | Creates an I/O watcher that listens for read events (C<$watch_write> |
60 | Creates an I/O watcher that listens for read events (C<$watch_write> |
59 | false) or write events (C<$watch_write> is true) on the file handle or |
61 | false) or write events (C<$watch_write> is true) on the file handle or |