a combinator to achieve something like this has been proposed several times
but I think there hasn't been consensus how to implement it exactly. The
latest approach is discussed here:
On Thursday, September 15, 2016 at 8:30:51 AM UTC+2, Paul Brown wrote:
> Hi Akka Stream Users,
> I'm fairly new to Akka Streams, and only just getting starting
> understanding some of its concepts.
> One problem I'm having is trying to understand how Tuples are handled in a
> stream. In my scenario I have a Source emitting Tuple2 of (ZipEntry(),
> ByteString()). ZipEntry contains basic information (name, date created)
> about the zip file, and the ByteString contains the extracted text of the
> zip file.
> I'm comfortable getting a stream performing a delimit of a ByteString with
> the following.
> Source.map(_._2).via(Framing.delimiter(ByteString("\n"), Int.MaxValue)))
> However, what I would like to be able to do is maintain the ZipEntry
> information alongside the ByteString for each new row created through the
> delimiter. That way I can process the stream further using groupBy etc.
> Example Source --> Sink
> Source input:
> (ZipEntry(name1.txt, date1), ByteString(58, 49, ..., 54, 58, ..., 48, 48,
> ...) )
> (ZipEntry(name2.txt, date2), ByteString(49, 58, ..., 58, 54, ..., 48, 48,
> ...) )
> Sink output:
> (ZipEntry(name1.txt, date), ByteString(58, 49, ...) )
> (ZipEntry(name1.txt, date), ByteString(54, 58, ...) )
> (ZipEntry(name1.txt, date), ByteString(48, 48, ...) )
> (ZipEntry(name2.txt, date), ByteString(58, 49, ...) )
> (ZipEntry(name2.txt, date), ByteString(54, 58, ...) )
> (ZipEntry(name2.txt, date), ByteString(48, 48, ...) )
> Should I be looking at a breaking it down into a RunnableGraph?
> Any help/pointers to documentation on the correct approach would be
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> 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 post to this group, send email to email@example.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.