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

Next steps for PromiseStream with ReactPHP v3 #40

Open
SimonFrings opened this issue Feb 23, 2024 · 0 comments
Open

Next steps for PromiseStream with ReactPHP v3 #40

SimonFrings opened this issue Feb 23, 2024 · 0 comments

Comments

@SimonFrings
Copy link
Member

We're currently moving forward with working on ReactPHP v3 and releasing the roadmap tickets for all our components (see reactphp/event-loop#271 and others). We still have some components that we haven't finalized plans for, especially with the next major version approaching. It's important to address how we can make sure these components are aligned with the upcoming ReactPHP v3.

We already opened a discussion for PromiseStream in https://github.com/orgs/reactphp/discussions/475 2 years ago, and with ReactPHP v3 around the corner, it's time to decide what to do here. To quote @clue from said ticket:

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() and all() functions. This interferes with IDE autocompletion, as our Promise component also offers a prominent all() function from a different namespace. Better names might perhaps be something along the lines of bufferString() and bufferArray(). 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.

There was a discussion about moving the ReactPHP PromiseStream component to Friends of ReactPHP, or if we simply reuse the logic elsewhere and deprecate the component afterwards together with the EOL of ReactPHP v1.

Happy about input on this, so let's discuss possible options and decide on what makes the most sense 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant