React Promise Rejection #494
Replies: 2 comments 4 replies
-
It depends a bit on what you want to do with the 400/500 range responses. You can return the rejection of those via https://reactphp.org/http/#withrejecterrorresponse and I belive this show answer your question on how MQ handles rejections: https://github.com/clue/reactphp-mq/blob/1.x/src/Queue.php#L51-L54 P.S. Just wrapped your code block in highlight mode to make it easier to read. |
Beta Was this translation helpful? Give feedback.
-
Hey @arunnabraham, thanks for sharing your code 👍 I'm interested in what you're trying to achieve with the shown example above. Understanding your use case helps me guiding you in the right direction and answering your questions (if you still have questions). |
Beta Was this translation helpful? Give feedback.
-
Hi team
While working on the ReactPHP HTTP client with MQ, I noticed one thing which I do not know whether it is a behavior or a bug.
My scenario is similar to
the following code.
instead of looping Browser promise API directly, I use reactphp-mq promise for the result, Also I finally want to merge three different APIs like shown in the above example into one result. But the result appears to reject the whole set if any of the api is a reject.
Or if it process in sequence, the if it is success on first, that is accepted. But if the next iteration is a reject, then the consecutive onces also ignored.
I tried promise\all() and promise\any() api, both gives same result.
So my question is how are we able to get the response of all the non-rejected APIs?
Beta Was this translation helpful? Give feedback.
All reactions