Skip to content

Commit

Permalink
added another Mojo::Reactor example
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 7, 2012
1 parent c84d885 commit 2572312
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Changes
@@ -1,6 +1,6 @@
This file documents the revision history for Perl extension Mojolicious.

2.77 2012-04-06
2.77 2012-04-07
- Improved documentation. (tempire, sri)
- Fixed small bug that prevented non-string secrets in Mojolicious.

Expand Down
5 changes: 5 additions & 0 deletions lib/Mojo/Reactor.pm
Expand Up @@ -132,6 +132,11 @@ Run reactor until at least one event has been handled or no events are being
watched anymore. Note that this method can recurse back into the reactor, so
you need to be careful. Meant to be overloaded in a subclass.
# Don't block longer than 0.5 seconds
my $id = $reactor->timer(0.5 => sub {});
$reactor->one_tick;
$reactor->remove($id);
=head2 C<recurring>
my $id = $reactor->recurring(0.25 => sub {...});
Expand Down

0 comments on commit 2572312

Please sign in to comment.