Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
better reactor documentation
  • Loading branch information
kraih committed Mar 22, 2012
1 parent 993e543 commit efc4414
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 39 deletions.
4 changes: 2 additions & 2 deletions lib/Mojo/Reactor.pm
Expand Up @@ -2,7 +2,7 @@ package Mojo::Reactor;
use Mojo::Base 'Mojo::EventEmitter';

use Carp 'croak';
use IO::Poll qw/POLLERR POLLHUP POLLIN POLLOUT/;
use IO::Poll qw/POLLERR POLLHUP POLLIN/;
use Mojo::Loader;

sub detect {
Expand Down Expand Up @@ -76,7 +76,7 @@ L<Mojo::Reactor> can emit the following events.
...
});
Emitted safely if an error happens.
Emitted safely for exceptions caught in callbacks.
$reactor->on(error => sub {
my ($reactor, $err) = @_;
Expand Down
17 changes: 1 addition & 16 deletions lib/Mojo/Reactor/EV.pm
Expand Up @@ -102,7 +102,7 @@ Mojo::Reactor::EV - Low level event reactor with libev support
=head1 DESCRIPTION
L<Mojo::Reactor::EV> is a low level event reactor based on C<libev>.
L<Mojo::Reactor::EV> is a low level event reactor based on L<EV>.
=head1 EVENTS
Expand Down Expand Up @@ -139,9 +139,6 @@ the reactor, so you need to be careful.
Create a new recurring timer, invoking the callback repeatedly after a given
amount of time in seconds.
# Invoke as soon as possible
$reactor->recurring(0 => sub { say 'Reactor tick.' });
=head2 C<start>
$reactor->start;
Expand All @@ -168,18 +165,6 @@ seconds.
Change I/O events to watch handle for with C<true> and C<false> values.
# Watch only for readable events
$reactor->watch($handle, 1, 0);
# Watch only for writable events
$reactor->watch($handle, 0, 1);
# Watch for readable and writable events
$reactor->watch($handle, 1, 1);
# Pause watching for events
$reactor->watch($handle, 0, 0);
=head1 SEE ALSO
L<Mojolicious>, L<Mojolicious::Guides>, L<http://mojolicio.us>.
Expand Down
21 changes: 0 additions & 21 deletions lib/Mojo/Reactor/Poll.pm
Expand Up @@ -161,12 +161,6 @@ implements the following new ones.
Watch handle for I/O events, invoking the callback whenever handle becomes
readable or writable.
# Callback will be invoked twice if handle becomes readable and writable
$reactor->io($handle => sub {
my ($reactor, $writable) = @_;
say $writable ? 'Handle is writable' : 'Handle is readable';
});
=head2 C<is_running>
my $success = $reactor->is_running;
Expand All @@ -187,9 +181,6 @@ the reactor, so you need to be careful.
Create a new recurring timer, invoking the callback repeatedly after a given
amount of time in seconds.
# Invoke as soon as possible
$reactor->recurring(0 => sub { say 'Reactor tick.' });
=head2 C<remove>
my $success = $reactor->remove($handle);
Expand Down Expand Up @@ -223,18 +214,6 @@ seconds.
Change I/O events to watch handle for with C<true> and C<false> values.
# Watch only for readable events
$reactor->watch($handle, 1, 0);
# Watch only for writable events
$reactor->watch($handle, 0, 1);
# Watch for readable and writable events
$reactor->watch($handle, 1, 1);
# Pause watching for events
$reactor->watch($handle, 0, 0);
=head1 SEE ALSO
L<Mojolicious>, L<Mojolicious::Guides>, L<http://mojolicio.us>.
Expand Down

0 comments on commit efc4414

Please sign in to comment.