Skip to content

Commit

Permalink
simplify multi-accept logic
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Sep 24, 2011
1 parent 9230aaf commit 5f9e639
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/Mojo/IOLoop.pm
Expand Up @@ -393,10 +393,8 @@ sub _listening {
return unless $i < $max;
if (my $cb = $self->on_lock) { return unless $self->$cb(!$i) }

# Try to guess the ideal number of accepts and start listening
my $accepts = $self->{accepts};
$accepts = 10 unless defined $accepts && $accepts > 0 && $accepts < 10;
$_->resume($max > 1 ? $accepts : 1) for values %$servers;
# Check if multi-accept is desirable and start listening
$_->resume($max > 1 ? 10 : 1) for values %$servers;
$self->{listening} = 1;
}

Expand Down

0 comments on commit 5f9e639

Please sign in to comment.