-
Notifications
You must be signed in to change notification settings - Fork 35
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
A single flow for all outgoing HTTP requests #729
base: 3.x
Are you sure you want to change the base?
Conversation
@skabashnyuk @evoevodin please review |
@@ -90,6 +92,10 @@ public boolean isValid(DeploymentSources deployment) { | |||
private ScheduledExecutorService cleanScheduler; | |||
private java.io.File deployDirectory; | |||
|
|||
@Inject | |||
private DownloadPlugin theDownloadPlugin; |
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.
Can you explain why we still need old field, looks like it is unused.
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.
@garagatyi the old field is final protected, not private. i saw it too risky to just remove it or hide non-incrementally.
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 didn't notice that, thanks.
@garagatyi the change now uses the same builder pattern. please review |
10d17fa
to
f385a76
Compare
@tareqhs Quick response is -1 to make HttpJsonRequest something not related to json. We understand that you want to make some tooling to make general request but making it in HttpJsonRequest is not that we want to achieve. I hope @garagatyi @evoevodin can add more to this statement. |
Hi @tareqhs.
The idea of you changes is clear for me and makes total sense, but the implementation strategy should be different, as As for me the best solution here is to create general class like |
hi @evoevodin @skabashnyuk , Well, that was the original approach in the PR but I tried to minimize code changes. The main issue is not whether to extend This is my suggestion : Agree? |
phase 1 - builder, runner, all json requests A new builder inteface HttpRequest, sharing features with the existing HttpJsonRequest, allows building general requests and consuming responses through HttpResponse. A single HTTP flow is achieving by sharing a single concrete HTTP request execution method. Signed-off-by: Tareq Sharafy <[email protected]> Change-Id: I2f334b7bb133b3f136d2b8e5b18301602f427355
f385a76
to
5ad5e27
Compare
phase 1 - builder, runner, all json requests
An injected interface, HttpRequestFactory, allows managing all outgoing
HTTP requests. HttpJsonRequest factory should use it internally. The
defult DefaultHttpJsonRequest as reusable as it accepts the general HTTP
factory in its constructor. Extensions can replace HttpJsonRequestFactory
and provide DefaultHttpJsonRequest as-is, given a different impl.
Signed-off-by: Tareq Sharafy [email protected]
Change-Id: I2f334b7bb133b3f136d2b8e5b18301602f427355