Quantcast
Channel: Akka Libraries - Discussion Forum for Akka technologies
Viewing all articles
Browse latest Browse all 1368

Combining Streams with disparate types

$
0
0

Apologies for the bad title, but not sure how to succinctly describe the question.

I have an unlimited Source[A, NotUsed] and a limited Source[B, NotUsed] where the latter is basically just a future that will return a list of B. I want to use the List[B] in logic to filter values in Source[A]

def getFilterList(filterCriteria): Future[Seq[Int]] = ???

def filterStream(filterCriteria: Int): Source[C, NotUsed] = {
  val mainSource: Source[A, NotUsed] = getMySource
  val filterSource: Source[Int, NotUsed] = Source.future(getFilterList(filterCriteria))

  // if List[A] contains a B, for example, convert B -> C in the output stream; otherwise, drop it
}

Can I combine these two sources in a way that accomplishes this?

Thanks!

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 1368

Trending Articles