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

Make concurrent requests whenever possible #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

naggingant
Copy link
Member

@naggingant naggingant commented Aug 10, 2020

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

if i == 0 {
cancel()
return nil, err
}
Copy link
Member

@PuKoren PuKoren Aug 11, 2020

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()

Copy link
Member Author

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.

Copy link
Member

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

Copy link
Member Author

@naggingant naggingant Aug 11, 2020

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.

Copy link
Member

@PuKoren PuKoren left a 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)

@naggingant
Copy link
Member Author

naggingant commented Aug 12, 2020

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.
In fact, all the tests are passing so we can still consider starting by opening an issue on their repo.

@PuKoren
Copy link
Member

PuKoren commented Aug 13, 2020

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 😁

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

Successfully merging this pull request may close these issues.

2 participants