markusthoemmes commented on a change in pull request #3812: ContainerClient + 
akka http alternative to HttpUtils
URL: 
https://github.com/apache/incubator-openwhisk/pull/3812#discussion_r203271931
 
 

 ##########
 File path: common/scala/src/main/scala/whisk/core/containerpool/HttpUtils.scala
 ##########
 @@ -80,20 +85,17 @@ protected class HttpUtils(hostname: String, timeout: 
FiniteDuration, maxResponse
    * @return Left(Error Message) or Right(Status Code, Response as UTF-8 
String)
    */
   def post(endpoint: String, body: JsValue, retry: Boolean)(
-    implicit tid: TransactionId): Either[ContainerHttpError, 
ContainerResponse] = {
+    implicit tid: TransactionId): Future[Either[ContainerHttpError, 
ContainerResponse]] = {
     val entity = new StringEntity(body.compactPrint, StandardCharsets.UTF_8)
     entity.setContentType("application/json")
 
     val request = new HttpPost(baseUri.setPath(endpoint).build)
     request.addHeader(HttpHeaders.ACCEPT, "application/json")
     request.setEntity(entity)
 
-    execute(request, timeout, maxConcurrent, retry)
+    Future { execute(request, timeout, maxConcurrent, retry) }
 
 Review comment:
   Should add `blocking` here as well. This is using sync IO.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to