Skip to content

Commit

Permalink
more Mojo::IOLoop documentation tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 27, 2012
1 parent d33017b commit 1fe63d0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
8 changes: 6 additions & 2 deletions lib/Mojo/IOLoop.pm
Expand Up @@ -523,7 +523,7 @@ amount of time in seconds.
my $id = $loop->recurring(3 => sub {...});
Create a new recurring timer, invoking the callback repeatedly after a given
amount of seconds.
amount of time in seconds.
# Run multiple reactors next to each other
my $loop2 = Mojo::IOLoop->new;
Expand Down Expand Up @@ -580,13 +580,17 @@ and the loop can be restarted by running C<start> again.
Get L<Mojo::IOLoop::Stream> object for id or turn object into a connection.
Note that this method is EXPERIMENTAL and might change without warning!
# Increase inactivity timeout for connection to 300 seconds
Mojo::IOLoop->stream($id)->timeout(300);
=head2 C<timer>
my $id = Mojo::IOLoop->timer(5 => sub {...});
my $id = $loop->timer(5 => sub {...});
my $id = $loop->timer(0.25 => sub {...});
Create a new timer, invoking the callback after a given amount of seconds.
Create a new timer, invoking the callback after a given amount of time in
seconds.
=head1 DEBUGGING
Expand Down
5 changes: 3 additions & 2 deletions lib/Mojo/IOWatcher.pm
Expand Up @@ -219,7 +219,7 @@ Check if watcher is running.
my $id = $watcher->recurring(3 => sub {...});
Create a new recurring timer, invoking the callback repeatedly after a given
amount of seconds.
amount of time in seconds.
=head2 C<start>
Expand All @@ -238,7 +238,8 @@ Stop watching for I/O and timer events.
my $id = $watcher->timer(3 => sub {...});
Create a new timer, invoking the callback after a given amount of seconds.
Create a new timer, invoking the callback after a given amount of time in
seconds.
=head2 C<watch>
Expand Down
5 changes: 3 additions & 2 deletions lib/Mojo/IOWatcher/EV.pm
Expand Up @@ -116,7 +116,7 @@ Check if watcher is running.
my $id = $watcher->recurring(3 => sub {...});
Create a new recurring timer, invoking the callback repeatedly after a given
amount of seconds.
amount of time in seconds.
=head2 C<start>
Expand All @@ -135,7 +135,8 @@ Stop watching for I/O and timer events.
my $id = $watcher->timer(3 => sub {...});
Create a new timer, invoking the callback after a given amount of seconds.
Create a new timer, invoking the callback after a given amount of time in
seconds.
=head2 C<watch>
Expand Down

0 comments on commit 1fe63d0

Please sign in to comment.