Skip to content

Commit

Permalink
documentation tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jul 5, 2012
1 parent c9d48ca commit 7566cfd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/Mojo/IOLoop.pm
Expand Up @@ -231,7 +231,7 @@ sub _manage {
if $c->{finish} && (!$c->{stream} || !$c->{stream}->is_writing);
}

# Graceful shutdown
# Graceful stop
$self->_remove(delete $self->{manager})
unless keys %$connections || keys %{$self->{servers}};
$self->stop if $self->max_connections == 0 && keys %$connections == 0;
Expand Down
12 changes: 6 additions & 6 deletions lib/Mojo/Server/Hypnotoad.pm
Expand Up @@ -213,15 +213,15 @@ sub _manage {
# Workers
while (my ($pid, $w) = each %{$self->{workers}}) {

# No heartbeat (graceful shutdown)
# No heartbeat (graceful stop)
my $interval = $c->{heartbeat_interval};
my $timeout = $c->{heartbeat_timeout};
if (!$w->{graceful} && ($w->{time} + $interval + $timeout <= time)) {
$self->{log}->info("Worker $pid has no heartbeat, restarting.");
$w->{graceful} = time;
}

# Graceful shutdown with timeout
# Graceful stop with timeout
$w->{graceful} ||= time if $self->{graceful};
if ($w->{graceful}) {
$self->{log}->debug("Trying to stop worker $pid gracefully.");
Expand Down Expand Up @@ -321,7 +321,7 @@ sub _spawn {
);
$loop->unlock(sub { flock $lock, LOCK_UN });

# Heartbeat messages (stop sending during graceful shutdown)
# Heartbeat messages (stop sending during graceful stop)
weaken $self;
$loop->recurring(
$c->{heartbeat_interval} => sub {
Expand Down Expand Up @@ -482,8 +482,8 @@ performance.
graceful_timeout => 15
Maximum amount of time in seconds a graceful worker stop may take before being
forced, defaults to C<30>.
Maximum amount of time in seconds stopping a worker gracefully may take before
being forced, defaults to C<30>.
=head2 C<group>
Expand All @@ -502,7 +502,7 @@ Heartbeat interval in seconds, defaults to C<5>.
heartbeat_timeout => 2
Maximum amount of time in seconds before a worker without a heartbeat will be
stopped, defaults to C<20>.
stopped gracefully, defaults to C<20>.
=head2 C<inactivity_timeout>
Expand Down
2 changes: 2 additions & 0 deletions lib/Mojolicious/Plugin/DefaultHelpers.pm
Expand Up @@ -263,6 +263,8 @@ Alias for L<Mojolicious::Controller/"session">.
Alias for L<Mojolicious::Controller/"stash">.
%= stash 'name' // 'Somebody'
=head2 C<title>
% title 'Welcome!';
Expand Down

0 comments on commit 7566cfd

Please sign in to comment.