Skip to content

Commit

Permalink
Set executor of CompletableFuture for response with no content. (heli…
Browse files Browse the repository at this point in the history
…don-io#4540)

* Set executor of CompletableFuture for response with no content.

* Fix copyright year

* Fix checkstyle
  • Loading branch information
MadsBrun authored and romain-grecourt committed Jul 22, 2022
1 parent 4907c00 commit d250eb2
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2021 Oracle and/or its affiliates.
* Copyright (c) 2020, 2022 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -204,7 +204,8 @@ public String getReasonPhrase() {

final CompletionStage<InputStream> stream = HelidonStructures.hasEntity(webClientResponse)
? webClientResponse.content().as(InputStream.class)
: CompletableFuture.supplyAsync(() -> NO_CONTENT_INPUT_STREAM);
: CompletableFuture.supplyAsync(() -> NO_CONTENT_INPUT_STREAM,
executorServiceKeeper.getExecutorService(requestContext));

return stream.thenApply((a) -> {
responseContext.setEntityStream(new FilterInputStream(a) {
Expand Down

0 comments on commit d250eb2

Please sign in to comment.