StructuredExecutor Incompatible with HttpClient?
Alan Bateman
Alan.Bateman at oracle.com
Mon Nov 29 17:57:20 UTC 2021
On 29/11/2021 16:23, Eric Kolotyluk wrote:
> :
>
> Again, using newThreadPerTaskExecutor(virtualThreadFactory) seems to
> work fine with HTTP Client, so there is something different about
> StructuredExecutor.
>
> Is it a goal or non-goal of Project Loom and/or Structured Concurrency
> <https://bugs.openjdk.java.net/browse/JDK-8277129> to interoperate
> with HTTP Client?
>
We should expect to work, in both async and synchronous forms. The
custom executor case will require a change in the HTTP client
implementation to ensure that the tasks are submitted from inside,
rather than outside, the tree. There are a couple of options for that.
For now, just avoid specifying the executor when creating the HTTP client.
-Alan.
More information about the loom-dev
mailing list