FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

refactor: use new stream feature by XadillaX · Pull Request #14 · node-modules/formstream · GitHub

refactor: use new stream feature - #14

Open
XadillaX wants to merge 1 commit into
node-modules:masterfrom
XadillaX:refactor/stream
Open

XadillaX wants to merge 1 commit into
node-modules:masterfrom
XadillaX:refactor/stream

Conversation

Copy link
Copy Markdown

This is a big refactor.

fengmk2 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

全 stream 模式写还是得再改改

Comment thread lib/formstream.js

var ps = parseStream().pause();
stream.pipe(ps);
if (this._isAllStreamSizeKnown) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

是否只需要 knownStreamSize 判断即可?

Comment thread lib/formstream.js

this._streams.push([leading, ps]);
if (options) {
for (const k in options) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

直接assign 即可,不需要考虑老的代码

Comment thread lib/formstream.js
});

stream.on('data', data => {
this.push(data);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

这样不对的,formstream 一旦开始读,下游消费很慢,然后导致子 stream 数据全部被塞到内存里面了。这里应该也是得走 readable 模式,主动去读

fengmk2 commented Sep 18, 2018

Copy link
Copy Markdown
Member

还需要管理传入来的 stream 异常情况

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL