-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
Closed
Labels
processIssues and PRs related to the process subsystem.Issues and PRs related to the process subsystem.streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.
Description
- Version: latest
- Platform: all
- Subsystem: node/lib/internal/process/stdio.js
sample code:
// hang process
setTimeout(function(){}, 9999999)
// in heavy development, there usually exists something that hangs the process.
// we use 'process.exit' to solve this quickly.
var stream = require('stream')
process.stdin
.pipe(new stream.PassThrough()) // there can be a list of Transform
.pipe(new stream.PassThrough()) // there can be a list of Transform
.pipe(new stream.PassThrough()) // there can be a list of Transform
.on('end', function() {
// process.exit()
// exit here will stop stdout from flushing
})
.pipe(process.stdout)
.on('finish', function() { // this event will not trigger
process.exit()
})
execution result: hangs forever
expect: process.stdout should behaves like a standard stream.
Metadata
Metadata
Assignees
Labels
processIssues and PRs related to the process subsystem.Issues and PRs related to the process subsystem.streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.