sven-lange-last commented on a change in pull request #4624: Combines active ack and slot release when both are available. URL: https://github.com/apache/openwhisk/pull/4624#discussion_r326038270
########## File path: core/controller/src/main/scala/org/apache/openwhisk/core/loadBalancer/CommonLoadBalancer.scala ########## @@ -204,17 +204,20 @@ abstract class CommonLoadBalancer(config: WhiskConfig, protected[loadBalancer] def processAcknowledgement(bytes: Array[Byte]): Future[Unit] = Future { val raw = new String(bytes, StandardCharsets.UTF_8) AcknowledegmentMessage.parse(raw) match { - case Success(m: CompletionMessage) => - processCompletion( - m.activationId, - m.transid, - forced = false, - isSystemError = m.isSystemError, - invoker = m.invoker) - activationFeed ! MessageFeed.Processed + case Success(acknowledegment) => + acknowledegment.isSlotFree.foreach { invoker => + processCompletion( + acknowledegment.activationId, + acknowledegment.transid, + forced = false, + isSystemError = acknowledegment.isSystemError.getOrElse(false), + invoker) + } + + acknowledegment.result.foreach { response => + processResult(acknowledegment.activationId, acknowledegment.transid, response) + } Review comment: Pretty elegant way to fold all three types of message into a single flow because `acknowledegment.isSlotFree` and `acknowledegment.result` are options. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to 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