Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use stream helpers #1

Closed
wants to merge 1 commit into from
Closed

fix: use stream helpers #1

wants to merge 1 commit into from

Conversation

ronag
Copy link
Contributor

@ronag ronag commented Mar 21, 2022

I've spent a lot of time sorting out problems with the eos & duplexity packages in core. Please use the core versions. 馃槃

proxy.setWritable(decode)
proxy.setReadable(encode)
eos(proxy, cleanup)
const proxy = Duplex.from({ writable: decode, readable: encode })
Copy link
Member

Choose a reason for hiding this comment

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

This requires node 16.8.0 and probably can't be browserified either because readable-stream is behind

Copy link
Member

Choose a reason for hiding this comment

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

Although, on the browser point, perhaps it's time to let go of the old and build something web stream-based

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sad but true... to both.

Copy link
Contributor Author

@ronag ronag Mar 21, 2022

Choose a reason for hiding this comment

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

Can we use Duplex.from if available and otherwise fallback to duplexify?

Copy link
Member

Choose a reason for hiding this comment

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

A few things I want to do first:

  1. Benchmark Duplex.from, I didn't try that yet. And design a more suitable benchmark, because I've focused mainly on iterators so far, less on one-of operations like put() and get(). And swap level for memory-level to remove fs from the equation. And bypass net sockets.
  2. Check compat with length-prefixed-stream which uses readable-stream and therefore doesn't satisfy core's willEmitClose logic. And length-prefixed-stream has its own destroy() 馃槥. Not sure what the effect is though, if any. Can you help with that?

Copy link
Member

Choose a reason for hiding this comment

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

I need some time to think about which flavor of streams to go with. It's a difficult question.

Copy link
Contributor Author

@ronag ronag Mar 21, 2022

Choose a reason for hiding this comment

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

I would personally not use readable-stream or any of the non-core helpers in production. But that's just my opinion. IMHO They are basically unmaintained and have lots of bugs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indirectly that unfortunately includes any lib that uses them.

@vweevers
Copy link
Member

vweevers commented Jul 2, 2022

Superseded by #7.

@vweevers vweevers closed this Jul 2, 2022
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.

None yet

2 participants