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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support custom stream creation #19

Open
matthewleon opened this issue Nov 26, 2017 · 9 comments
Open

support custom stream creation #19

matthewleon opened this issue Nov 26, 2017 · 9 comments
Labels
type: enhancement A new feature or addition.

Comments

@matthewleon
Copy link
Contributor

Is there any interest in supporting the creation of custom streams in this lib? I am working on a fork that does so, and wondering whether I should make a PR here, or create a separate lib.

@matthewleon
Copy link
Contributor Author

I've created a separate repo that has some basic tools for creating custom Readable streams here: https://github.com/matthewleon/purescript-node-readable

@cprussin
Copy link

Any reason why this isn't rolled into this lib? Would you guys accept a PR to include it @paf31? I'm happy to put in a PR for it, and I'd expect this lib to provide some way to create stream values...

@cprussin
Copy link

Ping @hdgarrood and @garyb on this one. Would you guys accept a PR to directly wrap the Node new Readable(), new Writable (), and new Duplex() or do you guys not think it belongs in this lib?

@matthewleon
Copy link
Contributor Author

@cprussin I'm happy to update my repo for PS 0.12 and then make a PR here. What do you think?

@cprussin
Copy link

@matthewleon sure, that would work; I'm just not sure if it's the kind of thing the owners of this repo want here or if they prefer it in a separate module--I'd rather let them chime in on that. I know that the intent behind purescript-node repos is to keep the APIs fairly bare bones.

@hdgarrood
Copy link
Member

Sorry for the late response. Yes, I think a basic wrapper for those APIs would make sense here.

@matthewleon
Copy link
Contributor Author

matthewleon commented Sep 2, 2018

@cprussin I've updated https://github.com/matthewleon/purescript-node-readable for PS 0.12 support, which trimmed a lot of the fat off the library. No more nasty effect rows.

That said, it might be worth paying attention to the newtype I created for Readable streams so that I could parameterize by chunktype. This library publishes a simpler API, but I think that if you are going to be creating custom streams, you really want that parameterization to preserve type safety.

So you would either want to update purescript-node-streams to include that parameterization, or leave these as separate libs. I'm curious to see if you have an elegant solution to this, as I sadly haven't spent much time thinking about it.

@cprussin
Copy link

cprussin commented Sep 2, 2018

I ended up going a different direction with the project that I was working on that needed custom streams, so I haven't been quite so motivated to dig into this more just yet. I'm sure the need will come back to me soon though, so when I get a chance to revisit, I'll let you know what I find. Thanks for updating the lib, that will be super helpful!

@matthewleon
Copy link
Contributor Author

Thanks for updating the lib, that will be super helpful!

No problem. It might be sensible to build yet another lib on top of it, offering a higher-level abstraction around the streams that takes care of serialization for you. I'd be curious to see the results if you do go down this path.

@JordanMartinez JordanMartinez added the type: enhancement A new feature or addition. label Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A new feature or addition.
Projects
None yet
Development

No branches or pull requests

4 participants