Skip to content

Commit

Permalink
Support per-call timeout in JdkHttpClient (#42932)
Browse files Browse the repository at this point in the history
  • Loading branch information
alzimmermsft authored Nov 14, 2024
1 parent b0d14bb commit 2ad2cb1
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ public Mono<HttpResponse> send(HttpRequest request) {
public Mono<HttpResponse> send(HttpRequest request, Context context) {
boolean eagerlyReadResponse = (boolean) context.getData(HttpUtils.AZURE_EAGERLY_READ_RESPONSE).orElse(false);
boolean ignoreResponseBody = (boolean) context.getData(HttpUtils.AZURE_IGNORE_RESPONSE_BODY).orElse(false);
Duration readTimeout = (Duration) context.getData(HttpUtils.AZURE_RESPONSE_TIMEOUT)
.filter(timeoutDuration -> timeoutDuration instanceof Duration)
.orElse(this.readTimeout);

Mono<java.net.http.HttpRequest> jdkRequestMono = Mono.fromCallable(() -> toJdkHttpRequest(request, context));

Expand Down

0 comments on commit 2ad2cb1

Please sign in to comment.