-
Notifications
You must be signed in to change notification settings - Fork 0
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
Make concurrent requests whenever possible #1
base: master
Are you sure you want to change the base?
Conversation
if i == 0 { | ||
cancel() | ||
return nil, err | ||
} |
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.
I'm not sure I got it right, but at this point isn't all the requests already made?
If that is true, then I think we can skip the check i == 0
to cancel()
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.
You are right, I think I did this to work around the existing tests; before this change, everything was executed in the order, so it didn't make sense to proceed after the first request failed.
I will see if I can infer the right behavior here.
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.
Got it, I couldn't see anything else so it looks good 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.
As far as I could find out, we only can halt the sequence when any required call failed, in order to keep the tests passing. I think it's a fair behavior.
Updated.
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.
Thanks for this, I think its very useful
I was thinking that we could submit the PR to krakend but it might break some stateful workflow so maybe that's why they didn't do it. In our case it is a nice addition, thanks!
(I didn't test the PR)
It is possible that they did not even consider this for foreseen complexity. And also it is definitely not sequential 😅 So better be named accordingly and added separately IMO. |
I think it would be a good idea, ideally it should be in the core framework. And in the worst case it might make us aware of some unexpected reasons on why it was not done As you achieved it, I think the honor to bring this up belongs to you 😁 |
When the sequential proxy is enabled the requests are not executed concurrently, but this branch modifies the behaviour by parsing the dependency first and dispatching only ready requests.
It can possibly make it to the origin, by adding some tests 🤔
@openrm/dev