[Http-Client] Use virtual thread executor by default
When on JDK 21+, the builder will default to the VirtualThreadPerTask Executor for the underlying HttpClient.
Did someone request this change or do we just think it's a good idea?
I just think it's cool
@rbygrave yea or nay?
yea or nay?
As I see it, this looks like a good idea but I'm not quite 100% sure myself. So I'm sitting on the fence waiting for someone to hit a use case where they want this as the default. I guess the JDK HttpClient has to be more conservative which is perhaps why this isn't the default in the JDK.
If we merge this so that it becomes the default behaviour then it is hard to "undo" that in that doing so would be a "silent regression" type of change.
In this sense we need to be 100% sure when/if we merge this. For myself I'm not quite 100% yet. Can we keep this on hold for now?
I'm hearing nay (at least for now)
Ok, but if we leave the PR open ... then other people can see it and add a comment. If we delete the PR it's now really unlikely to happen?
[My preference was to keep the PR open]
Maybe best to wait until JEP 491 gets merged
Maybe best to wait until JEP 491 gets merged
I mean the current implementation of HTTP client doesn't use synchronized anyways
Ok, I'm thinking maybe we should merge this in with the thinking that this should be a reasonable default in a Java 21+ world.
That is, bump the next released version to 3.0 and merge this in.