Skip to content

Commit

Permalink
more timer examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed May 21, 2012
1 parent a181b9a commit 77625e0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Mojo/IOLoop.pm
Expand Up @@ -511,6 +511,9 @@ that this method can recurse back into 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
Mojo::IOLoop->recurring(0 => sub { say 'Reactor tick.' });
=head2 C<remove>
Mojo::IOLoop->remove($id);
Expand Down Expand Up @@ -584,6 +587,9 @@ Get L<Mojo::IOLoop::Stream> object for id or turn object into a connection.
Create a new timer, invoking the callback after a given amount of time in
seconds.
# Invoke as soon as possible
Mojo::IOLoop->timer(0 => sub { say 'Next tick.' });
=head1 DEBUGGING
You can set the C<MOJO_IOLOOP_DEBUG> environment variable to get some advanced
Expand Down

0 comments on commit 77625e0

Please sign in to comment.