Skip to content

Commit

Permalink
better descriptions for accept mutex callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed May 28, 2012
1 parent 0ed7e27 commit 79db109
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lib/Mojo/IOLoop.pm
Expand Up @@ -373,14 +373,14 @@ defaults to L<Mojo::IOLoop::Client>.
my $cb = $loop->lock;
$loop = $loop->lock(sub {...});
A locking callback that decides if this loop is allowed to accept new incoming
connections, used to sync multiple server processes. The callback should
return true or false. Note that exceptions in this callback are not captured.
A callback for acquiring the accept mutex, used to sync multiple server
processes. The callback should return true or false. Note that exceptions in
this callback are not captured.
$loop->lock(sub {
my ($loop, $blocking) = @_;
# Got the lock, listen for new connections
# Got the accept mutex, start listening
return 1;
});
Expand All @@ -402,7 +402,8 @@ connections indefinitely.
The maximum number of parallel connections this loop is allowed to handle
before stopping to accept new incoming connections, defaults to C<1000>.
Setting the value to C<0> will make this loop stop accepting new connections
and allow it to shutdown gracefully without interrupting existing connections.
and allow it to shut down gracefully without interrupting existing
connections.
=head2 C<reactor>
Expand Down Expand Up @@ -439,8 +440,8 @@ to L<Mojo::IOLoop::Stream>.
my $cb = $loop->unlock;
$loop = $loop->unlock(sub {...});
A callback to free the accept lock, used to sync multiple server processes.
Note that exceptions in this callback are not captured.
A callback for releasing the accept mutex, used to sync multiple server
processes. Note that exceptions in this callback are not captured.
=head1 METHODS
Expand Down

0 comments on commit 79db109

Please sign in to comment.