rabbah commented on a change in pull request #3421: Add ElasticSearch Log Store
URL: 
https://github.com/apache/incubator-openwhisk/pull/3421#discussion_r173699804
 
 

 ##########
 File path: common/scala/src/main/scala/whisk/http/PoolingRestClient.scala
 ##########
 @@ -55,16 +63,18 @@ class PoolingRestClient(protocol: String, host: String, 
port: Int, queueSize: In
     Http().cachedHostConnectionPoolHttps[Promise[HttpResponse]](host = host, 
port = port)
   }
 
+  private val defaultHttpFlow = pool.mapMaterializedValue { x =>
+    poolPromise.success(x); x
+  }
+
   private val poolPromise = Promise[HostConnectionPool]
 
   // Additional queue in case all connections are busy. Should hardly ever be
   // filled in practice but can be useful, e.g., in tests starting many
   // asynchronous requests in a very short period of time.
   private val requestQueue = Source
     .queue(queueSize, OverflowStrategy.dropNew)
-    .via(pool.mapMaterializedValue { x =>
-      poolPromise.success(x); x
-    })
+    .via(httpFlow.getOrElse(defaultHttpFlow))
     .toMat(Sink.foreach({
       case ((Success(response), p)) => p.success(response)
 
 Review comment:
   I can?t  tell just from looking at these few lines of the one promise is 
being competed twice or if it?s two different promises. 

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to