-
Enhancement
-
Resolution: Unresolved
-
P4
-
None
We should consider to introduce a new AP method:
`<U> HttpResponse<U> HttpResponse::map(Function<T,U> mapper);`
This way we could also promote the following:
HttpResponse<W> resp =
client.sendAsync(req, BodySubscribers.ofInputStream())
.thenApplyAsync(r -> r.map(toJSON(W.class, r.body()))
.join();
This would allow the caller to decide whether to performed the mapping in a synchronous or asynchronous dependent action, as well as allowing him to supply an executor if he so wishes.
`<U> HttpResponse<U> HttpResponse::map(Function<T,U> mapper);`
This way we could also promote the following:
HttpResponse<W> resp =
client.sendAsync(req, BodySubscribers.ofInputStream())
.thenApplyAsync(r -> r.map(toJSON(W.class, r.body()))
.join();
This would allow the caller to decide whether to performed the mapping in a synchronous or asynchronous dependent action, as well as allowing him to supply an executor if he so wishes.
- relates to
-
JDK-8217627 HttpClient: The API documentation of BodySubscribers::mapping promotes bad behavior
-
- Closed
-
-
JDK-8217264 HttpClient: Blocking operations in mapper function do not work as documented
-
- Closed
-