Figured it out.  In my custom Bidi, I needed to override the default 
onUpstreamFinish() and onDownStreamFinish() methods on the in/out handlers, 
since by default they complete the entire stage (i.e. the whole Bidi). 
 This meant that the completion of the requestIn port (invoked after the 
single message from the source was received), the stage was completed 
before the message could flow through the response flow.  The fixed code is 
pasted below:

override def createLogic(inheritedAttributes: Attributes): GraphStageLogic = 
new GraphStageLogic(shape) {
  setHandler(requestIn, new InHandler {
    override def onPush(): Unit = {
      push(requestOut, grab(requestIn))
    }
    override def onUpstreamFinish() = complete(requestOut)
  })

  setHandler(requestOut, new OutHandler {
    override def onPull(): Unit = {
      pull(requestIn)
    }
    override def onDownstreamFinish() = cancel(requestIn)
  })

  setHandler(responseIn, new InHandler {
    override def onPush(): Unit = {
      val msg = grab(responseIn)
      push(responseOut, msg)
    }
    override def onUpstreamFinish() = completeStage()
  })

  setHandler(responseOut, new OutHandler {
    override def onPull(): Unit = {
      pull(responseIn)
    }
    override def onDownstreamFinish() = cancel(responseIn)
  })
}



-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to