Skip to content

Commit

Permalink
no need to emit the close event so often
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Aug 27, 2016
1 parent 54f53cf commit 0dd2584
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
2 changes: 0 additions & 2 deletions lib/Mojo/IOLoop/Stream.pm
Expand Up @@ -8,8 +8,6 @@ use Scalar::Util 'weaken';

has reactor => sub { Mojo::IOLoop->singleton->reactor };

sub DESTROY { Mojo::Util::_global_destruction() or shift->close }

sub close {
my $self = shift;
return unless my $reactor = $self->reactor;
Expand Down
2 changes: 0 additions & 2 deletions lib/Mojo/IOLoop/Subprocess.pm
Expand Up @@ -35,10 +35,8 @@ sub run {
$self->ioloop->stream($stream);
my $buffer;
$stream->on(read => sub { $buffer .= pop });
my $parent = $$;
$stream->on(
close => sub {
return unless $$ == $parent;
waitpid $self->{pid}, 0;
return $self->$second("Non-zero exit status (@{[$? >> 8]})") if $?;
my $result = eval { $self->deserialize->($buffer) } || [];
Expand Down

0 comments on commit 0dd2584

Please sign in to comment.