Closed Gugu7264 closed 5 months ago
Thanks @Gugu7264 for the PR and your help on the other issues.
flush
instead of flushPooled
? Was flushPooled
added to prevent a breaking change? If so, next version will have several breaking changes so we could group them together.It's indeed added as a separate function because of the breaking change behavior of using a callback instead if returning/yielding something. Apart from that, I do not think there's any advantage. Will fix tests and add tests
- Apparently some tests are failing
- Can you add a test for when the user chooses flushPooled instead of flush please? (depending on the answer of 1 ;) )
@Minishlink Here are 2 commits that should fix 2. and 3. I haven't done community PHP development before and wasn't aware of the tests set up in composer, hence the failing (I was missing a comma...).
I've now run the tests, apart from test:unit
(but I ran test:unit_offline
) so everything should be good now :)
- Is there any advantage to use flush instead of flushPooled? Was flushPooled added to prevent a breaking change? If so, next version will have several breaking changes so we could group them together.
As for this, I added this as separate since I don't know when will next version come, but I can change it for the next breaking version? (maybe there should be a separate branch for the breaking version?)
Here's a fixed version @Minishlink
Fixes #367, fixes #195.
Since making use of the
Pool
refrains from returning anything to the user, acallback
argument is added in the newflushPooled
function, which will get called for each response received.It was mentioned in #367 to transform the
prepare
method into a Generator, but that's not possible if we want to be able to return the Request alongside the Response.