-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add setMaxListeners to stream.prototype #2
Conversation
Current coverage is 96.15% (diff: 100%)@@ master #2 diff @@
==========================================
Files 1 1
Lines 50 52 +2
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 49 50 +1
- Misses 1 2 +1
Partials 0 0
|
|
||
// https://github.com/nodejs/readable-stream/blob/master/lib/_stream_readable.js#L667 | ||
// readable-stream is listening event on the prototype of stream | ||
stream.prototype.setMaxListeners(100); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为啥要修改全局的?
因为他用了全局的
fengmk2 <notifications@github.com>于2016年12月1日 周四23:45写道:
… ***@***.**** commented on this pull request.
------------------------------
In index.js
<#2 (review)>
:
> @@ -5,6 +5,11 @@ const Console = require('console').Console;
const through = require('through2');
const split = require('split2');
const pumpify = require('pumpify');
+const stream = require('stream');
+
+// https://github.com/nodejs/readable-stream/blob/master/lib/_stream_readable.js#L667
+// readable-stream is listening event on the prototype of stream
+stream.prototype.setMaxListeners(100);
为啥要修改全局的?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAWA1fgrnq1rWTaeU1EhD4Qc5RZU-Qkgks5rDuutgaJpZM4LBfUG>
.
|
谁用了?没看懂上下文。 |
看上面的注释
fengmk2 <notifications@github.com>于2016年12月2日 周五00:43写道:
… 谁用了?没看懂上下文。
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAWA1RZS092jGqcb8I_PyRys7qNZkTxGks5rDvk0gaJpZM4LBfUG>
.
|
那也应该只是设置一个 Readable 实例的才对,而不是全局的。 |
他最终监听的是全局的
fengmk2 <notifications@github.com>于2016年12月2日 周五01:02写道:
… 那也应该只是设置一个 Readable 示例的才对,而不是全局的。
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAWA1QPE4Rv-_YcWkbyYTvWS4RzU2szxks5rDv2RgaJpZM4LBfUG>
.
|
我尝试下不用他的库 |
227d5e5
to
9114a10
Compare
改了,readable-stream 是继承 stream 的,设在这个上面也是可以的,不过总感觉实现奇怪。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
@popomore 你来发布吧。 |
|
readable-stream is listening event on the prototype of stream