Promistreams are now officially in beta! :boost_requested: (Which mostly just means I have added a little infobox at the top of the page :blobcatgiggle: )

wiki.slightly.tech/books/proje

Basically, they're streams for that are actually nice to work with, have first-class Promise support, handle errors correctly, handle concurrency reliably, interoperate with other stream implementations, and just generally make more sense than Node streams.

You can use them for streaming data, but also for things like task queues or distribution patterns. They can work in any JS environment, and are not limited to Node.js. More documentation will become available soon (especially for more complex cases), but the basic stuff is already explained at the link.

Please give them a try and let me know how it went, and whether you ran into any issues!

@joepie91 Interesting, how do you see meshing these ideas in the frontend?

Brutally, I'm a very dumb React.js (or the ideas of it) enjoyer and I came to desire something meshing Rx.js-style stuff and pure components for real-time purposes. Is there a place for this sort of need, or would that come later?

@raito So Promistreams are agnostic to the values that go through them; you totally could use them to design some sort of streaming component system (by streaming through component-shaped objects), but Promistreams *themselves* do not do anything with components, and it wouldn't be directly in scope.

Someone actually compared Promistreams to Rx.js earlier today, in concept, so you're probably not far off with your idea :)

(There *is* a plan to write an Rx.js adapter stream which can convert between Rx.js and Promistreams bidirectionally, so if such a component system already exists based on Rx.js, then Promistreams could plausibly interoperate with it)

@joepie91 Is there any conditions on the values that go through the Promistreams?

I assume they need to be at least serializable right?

Follow

@raito No conditions whatsoever, including and up to supporting `null` values, as there is no serialization step involved anywhere (unless you add a serialization stream, of course).

You represent the processing steps as a linear(-ish) Promistream pipeline in your code, but behind the scenes that essentially gets converted into a long chain of Promise handlers, so anything that can go in a Promise (which is everything) can go into a Promistream too :)

· · Web · 0 · 0 · 0
Sign in to participate in the conversation
Pixietown

Small server part of the pixie.town infrastructure. Registration is closed.