Pass Future to Sink.ignore, how do I know it's completed

26 views
Skip to first unread message

Gary Struthers

unread,
Jul 21, 2016, 5:50:13 PM7/21/16
to Akka User List
My Sink receives a Future. I don't want to do anything with it so I use Sink.ignore but then I don't know when it's completed and that I need to know. Should I write a custom Sink or does the API already have a solution for this?

Gary

Johan Andrén

unread,
Jul 23, 2016, 4:01:14 AM7/23/16
to Akka User List
You can go from a stream of Future[T] to a stream of T by using mapAsync that way your stream will actually complete when the last future completes, Sink.ignore will materialize into a Future[Done] which completes when the stream completes, so those two in combination should be one solution.

--
Johan
Reply all
Reply to author
Forward
0 new messages