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

Grouping and merging sorted Streams

$
0
0

Hello,

Given a type A that has a property A.location, I have some streams that emit objects of type A such that A.location is always in ascending order, but there may be some consecutive objects that have the same location, and ordering between objects with the same location is undefined.

Given a stream that emits objects of type A, say Source[A, Mat1], how can I group consecutive objects with the same location, say Source[Set[A], Mat2]?

Given multiple streams of A, say Seq[Source[A, Mat1]], I want a new stream that emits collections, such that each collection contains all objects with the same location, but in such a way, that I can still find, which object came from which stream. So, it couldn’t just be Set[A], because then I wouldn’t know which object came from which stream. I need, for example, something like Source[Seq[Set[A]], Mat3], where the first element is the set of objects from the first stream and so on.

Thanks!

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 1362