-
-
Notifications
You must be signed in to change notification settings - Fork 86
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 JDK 11 HttpClient #158
Conversation
@nafg you'll need to bump the Java 8 minimum version to Java 11 I think Could you also write up a PR description summarizing the major changes/decisions/etc. |
Sure. I need to clean up the code and commits too. |
Also, I haven't implemented the async API yet |
Am I supposed to update something for the bincompat check? Or do you just ignore it when you want to do a breaking release? |
@nafg let's ignore it for now, once things are settled we can see how easy it is to maintain bincompat or whether we should just release a new breaking version |
I think the code is settled enough to decide this. Here are the breaking changes as I recall:
Actually, at this point, If we want to be backwards compatible we could leave RequestBlob as is, introspect If we mainly care about source compatibility we could leave RequestBlob as is, change If we don't want to define implicit conversions to Writable instead of RequestBlob, or we can't because of implicit scope rules, we could have a new data type with some other name that literally just wraps a Writable, includes the same implicit conversions as RequestBlob plus a conversion from RequestBlob, and then the data parameter will be of that type. It would still be a binary breaking change because we've changed the type of |
I should update the commit messages and the README, and add the async APIs, but aside for the discussion questions I think I'm happy with the code (although I can look it over again). |
At a first glance, it looks reasonable. I did a cursory pass on the code, but if you could write up the PR description about the major things a reviewer should know of the approach that would help a lot Binary compatibility is more important than source compatible (due to potentially-unsolvable diamond dependency problems), so if it's not too hard to preserve I'd say we go with that. I think a fixed map of I think we should leave If it's not too onerous, then getting |
@nafg bump on this :) just making sure you didn't miss my response |
Is there a reason why |
Any why in one case it's passed in as |
Oops, I defaulted the statusMessage to |
I'm getting a lot of
|
Note that I deprecated |
I updated the PR description. Is that enough detail or should I go into the internal changes? P.S. the status messages were generated with ChatGPT. |
Note: I still didn't implement the async API |
I suspect the place where it's passed as
I think that's fine
Yes that's fine
Do go into the internal changes as well; the PR description is for future maintainers too, not just for downstream library users
Is it possible to get this list from a more authoritative source, like some RFC? We should add a comment with a link to the source so people know where it came from
Is it easy to implement? From the sound of it it's mostly the same as the sync API, just that it needs a |
If async proves tricky, I think I would be fine dropping that as a requirement for this ticket and bounty. Just the synchronous API should be enough |
Originally I thought it was basically a matter of adapting the Java Future to a Scala Future, which is a bit harder for Scala 2.11 IIRC. But since we are still using RequestBlob / Writable which is why we are writing on the caller thread, I don't see how we are any more in a position to have an async API than before.
I mean how is that different than just having the caller wrap the call in I wonder if you'd be interested in a call to discuss some of the design decisions and tradeoffs? |
Let's drop async for now. Maybe we can pick it up in a follow up bounty, but right now it's orthogonal to the core requirement of getting onto java HttpClient and will require more invasive hanges to the API that will take more time to consider |
@nafg looks like CI is green, if you update the PR description and I give it another round of review then we can merge it and close out the bounty |
I don't really understand what else to write |
@nafg that's fine, if you're done with this I can merge it and close this out |
I think so... I would suggest that because of the nature of the change it might be worth having an RC period, even though I don't think most of your libraries usually do that. What if there's some implementation difference between HttpURLConnection and JDK http client that affects users that we aren't aware of, and fixing it really does require a breaking change? |
Fix #150
HttpURLConnection
to JDK 11'sHttpClient
statusMessage
no longer provides access to the "reason phrase" sent by the server. Instead a hardcodedMap
is used.