-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Unsubscribe single-use event handlers after use
--stream.on('close', closeHandler);
--stream.on('end', closeHandler);
++stream.once('close', closeHandler);
++stream.once('end', closeHandler);Avoid unnecessary closure
stream.on('data', function(data) {
tasks.push(data);
if (running < concurrency) {
startNextTask();
} else {
-- stream.pause();
++ this.pause();
}
});Metadata
Metadata
Assignees
Labels
No labels