Replies: 2 comments 2 replies
-
This is IMHO one of the packages we have that makes sense in testing and very specific edge cases. If anything and we don't need it in the core anymore I would suggest moving it to Friends of ReactPHP. Some of my package's testing relies on it. (Mainly stream modifiers.) And there are, regardless of the future of vNEXT niches where it will fit. And I suppose this response already answers your question ;). |
Beta Was this translation helpful? Give feedback.
-
Adding another use-case here for |
Beta Was this translation helpful? Give feedback.
-
We're currently in the process of planning the future of ReactPHP in https://github.com/orgs/reactphp/discussions/472, so I'd like to use the chance to discuss what (if any) future our reactphp/promise-stream package has.
The way I see it, the project is only used for its
buffer()
function for the most part (in fact, this is also why this package was born: reactphp/stream#45). If you take a look at the installation stats, you'll see that close to 100% of all installations come from reactphp/http. To make matters worse, the HTTP component has to work around some of the edge cases of buffering closed streams, so it might as well just implement 10 lines of code without an additional dependency.I will argue that installing an entire project for a single function only is a bit overkill (for the PHP ecosystem at least). Likewise, maintaining an entire project requires a non-trivial amount of work – which I'd rather redirect towards our main components.
To add insult to injury, the package also features poorly-named
first()
andall()
functions. This interferes with IDE autocompletion, as our Promise component also offers a prominentall()
function from a different namespace. Better names might perhaps be something along the lines ofbufferString()
andbufferArray()
. But renaming would incur a BC break, so we'd either have to wait for vNEXT or spend even more effort and add additional functions and deprecate the existing ones.As such, I wonder if we should keep this as a separate component or we should perhaps deprecate this component and reuse the logic elsewhere as needed?
Beta Was this translation helpful? Give feedback.
All reactions