-
Notifications
You must be signed in to change notification settings - Fork 6
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
Use react/async for promise wait #50
Use react/async for promise wait #50
Conversation
db364c9
to
e2198b6
Compare
e2198b6
to
2fff833
Compare
please let me know if you need any input (i have no experience with react though) |
@dbu Will do! I think the only thing might be the |
efe7b8c
to
a4574ed
Compare
$loop->run(); | ||
try { | ||
await($this->promise); | ||
} catch (\Throwable) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it correct to eat away the exception and not do anything with it? seems dangerous to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check lines 82 to 96, and 123 to 129. In theory that will cover the swallowing here. This is something I'm considering changing but not sure what the best approach is yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, i see yep. thanks for the explanation.
what happens with line 128 if there was an exception and we chose not to unwrap? the response will be null, right? but that will have been the same before if i understand correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I kept the behavior the same as before. Not unwrapping is a very conscious call to swallow any error that might come up.
a4574ed
to
e4f58f3
Compare
i fixed the static analysis in the master branch. can you please rebase? what is needed to wrap this MR up? |
Will do so tonight 👍
A stable release of |
ah nice! i will now be away until next week, will check back then and tag a release of this adapter if its ready. |
e4f58f3
to
bbd20b0
Compare
@dbu Ok so funny thing, it seems that the static analysis runs on PHP 8.0, and this PR raises the minimum PHP version to 8.1 😂 . Code coverage has a similar issue, but that is running on PHP 7.4. |
can you please adjust the php version for code coverage? with static analysis its a bit more tricky, as we use the oskarstark phpstan image. i created OskarStark/phpstan-ga#53 to try to upgrade to php 8.1 |
bbd20b0
to
d4dab3b
Compare
Oops I missed that was hardcoded. Just updated that.
How open are you to alternatives? Could look into using a github action for it. |
the thing we use is a github action ;-) oskar already merged the upgrade and tagged it. i now restarted the build and its green \o/ the codestyle error is because it wants the use function to have a newline before and after - maybe put the |
d4dab3b
to
7e14dfd
Compare
Move and also bump phpunit/phpunit to require dev as it was wrongfully place in require in php-http#52.
7e14dfd
to
2dcaf60
Compare
Oh hah it looked like it was just a docker container.
Great!
Tried that, but it wants the empty lines before and after it in the current position |
sorry about the thanks a lot for the contribution, i will merge now. should this be a version 3 or does the change merit a major version bump? and should i already tag a release, or are you doing more testing? |
No worries, I respect and follow the CS rules of the project without complaining, how silly they might look to me 😃 .
Would go for a major version bump IMHO because the mechanic of how you wait changes and now requires fibers.
Give me a week to test it in a project. Need to set up Sentry for it, should be fun :D |
great! i merged and set up the 4.x branch for it (getting rid of confusing & politically incorrect can you please update the changelog with more details and maybe a short instruction how to adapt usage? and let me know when to tag a release ;-) |
That took a bit longer than intended sorry. But I come bearing the goodest of news
👍
Will do 👍.
Let me file a changelog update and we're good to go. I've tested the 4.x branch in a project for Sentries HTTP transport. Running without any issues what so ever <3. |
I somehow missed those while working on php-http#50
I somehow missed those while working on php-http#50
I somehow missed those while working on php-http#50
What's in this PR?
Change promise implementation to not block
Why?
Avoid blocking, see #49
Checklist