Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
better Mojo::Reactor examples
  • Loading branch information
kraih committed Jun 15, 2012
1 parent e65f64d commit 777b9e1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/Mojo/Reactor.pm
Expand Up @@ -182,7 +182,8 @@ seconds. Meant to be overloaded in a subclass.
$reactor = $reactor->watch($handle, $readable, $writable);
Change I/O events to watch handle for with C<true> and C<false> values, meant
to be overloaded in a subclass.
to be overloaded in a subclass. Note that this method requires an active I/O
watcher.
# Watch only for readable events
$reactor->watch($handle, 1, 0);
Expand Down
6 changes: 5 additions & 1 deletion lib/Mojo/Reactor/EV.pm
Expand Up @@ -86,6 +86,9 @@ Mojo::Reactor::EV - Low level event reactor with libev support
say $writable ? 'Handle is writable' : 'Handle is readable';
});
# Change to watching only if handle becomes writable
$reactor->watch($handle, 0, 1);
# Add a timer
$reactor->timer(15 => sub {
my $reactor = shift;
Expand Down Expand Up @@ -159,7 +162,8 @@ seconds.
$reactor = $reactor->watch($handle, $readable, $writable);
Change I/O events to watch handle for with C<true> and C<false> values.
Change I/O events to watch handle for with C<true> and C<false> values. Note
that this method requires an active I/O watcher.
=head1 SEE ALSO
Expand Down
6 changes: 5 additions & 1 deletion lib/Mojo/Reactor/Poll.pm
Expand Up @@ -139,6 +139,9 @@ Mojo::Reactor::Poll - Low level event reactor with poll support
say $writable ? 'Handle is writable' : 'Handle is readable';
});
# Change to watching only if handle becomes writable
$reactor->watch($handle, 0, 1);
# Add a timer
$reactor->timer(15 => sub {
my $reactor = shift;
Expand Down Expand Up @@ -222,7 +225,8 @@ seconds.
$reactor = $reactor->watch($handle, $readable, $writable);
Change I/O events to watch handle for with C<true> and C<false> values.
Change I/O events to watch handle for with C<true> and C<false> values. Note
that this method requires an active I/O watcher.
=head1 SEE ALSO
Expand Down

0 comments on commit 777b9e1

Please sign in to comment.