Hi,
I'm seeing an issue where the graph completes while there is still data in
one of the flows. The last element emitted by the source enters a custom
GraphStageLogic flow, where it is sent to a function that returns a Future.
That Future has a callback which invokes getAsyncCallback and then
push(out). For the last element, the Future callback fires (pushCallback
.invoke(xml)) but the AsyncCallback is never invoked and the graph stops.
For more context, this is what I have going on inside the GraphStageLogic:
val s3ListBucket: Source[ByteString, NotUsed] =
s3Client.listBucket(bucket, Some(currentPrefix), maxKeys, nextMarker)
val bucketListingXml: Future[String] = s3ListBucket
.map(_.utf8String)
.runWith(Sink.seq)(materializer)
.map(_.mkString)(materializer.executionContext)
bucketListingXml.foreach {
xml =>
println(s"This gets called. prefix $currentPrefix")
pushCallback.invoke(xml)
}(materializer.executionContext)
And the callback
val pushCallback = getAsyncCallback[String] { xml =>
log.info(s"This is never called for last element in graph!")
push(out, xml)
}
I don't see any errors and this issue consistently occurs on the last
element. Thanks
Andrew
--
>>>>>>>>>> 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.