Navigation Menu

Skip to content

Commit

Permalink
better description for finish event
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 17, 2015
1 parent b563152 commit 035611a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion lib/Mojo/IOLoop.pm
Expand Up @@ -323,7 +323,8 @@ the following new ones.
...
});
Emitted when the event loop shuts down gracefully.
Emitted when the event loop wants to shut down gracefully and is just waiting
for all existing connections to be closed.
=head1 ATTRIBUTES
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Server/Prefork.pm
Expand Up @@ -153,10 +153,10 @@ sub _spawn {
$self->cleanup(0)->setuidgid;

# Heartbeat messages
weaken $self;
my $loop = $self->ioloop;
my $finished = 0;
$loop->on(finish => sub { $finished = 1 });
weaken $self;
my $cb = sub { $self->_heartbeat($finished) };
$loop->next_tick($cb);
$loop->recurring($self->heartbeat_interval => $cb);
Expand Down
2 changes: 1 addition & 1 deletion t/mojo/websocket.t
Expand Up @@ -60,7 +60,7 @@ websocket '/socket' => sub {
websocket '/early_start' => sub {
my $c = shift;
$c->send('test1');
$c->on(message => sub { shift->send(shift . 'test2')->finish });
$c->on(message => sub { shift->send(shift() . 'test2')->finish });
};

websocket '/denied' => sub {
Expand Down
2 changes: 1 addition & 1 deletion t/mojo/websocket_proxy.t
Expand Up @@ -25,7 +25,7 @@ get '/proxy' => sub {

websocket '/test' => sub {
my $c = shift;
$c->on(message => sub { shift->send(shift . 'test2') });
$c->on(message => sub { shift->send(shift() . 'test2') });
};

# HTTP server for testing
Expand Down
2 changes: 1 addition & 1 deletion t/mojo/websocket_proxy_tls.t
Expand Up @@ -40,7 +40,7 @@ get '/proxy' => sub {

websocket '/test' => sub {
my $c = shift;
$c->on(message => sub { shift->send(shift . 'test2') });
$c->on(message => sub { shift->send(shift() . 'test2') });
};

# Web server with valid certificates
Expand Down

0 comments on commit 035611a

Please sign in to comment.