In case anybody stumbles on this.  I solved this by using Unzip then a Zip. 
 Not sure if it is the proper way to do it...  Anyway, the program I wrote 
downloads files from PipeDrive which resulted in a few fairly complex flows 
- one even has a cycle in it.  Would love some feedback on it if anybody 
has the time:

https://gist.github.com/matthewpflueger/7059483cb0809c8bc91a


On Wednesday, March 11, 2015 at 4:29:09 PM UTC-4, Matthew wrote:
>
> I'm a newbie with Akka Streams so please excuse me if the question seems 
> stupid.  I have the need to pass some context info along with the events in 
> a stream.  For example, I have something like the following (doesn't 
> compile - just for illustration):
>
>
> case class RequestFile(
>     req: HttpRequest,
>     fileId: Int,
>     fileName: String)
>
>
> case class ResponseFile(
>       res: HttpResponse,
>       fileId: Int,
>       fileName: String)
>
> val connection: Flow[HttpRequest, HttpResponse, 
> Future[OutgoingConnection]] =  Http().outgoingConnection("api.mydomain.com
> ")
>
>
> val downloadFile: Flow[RequestFile, ResponseFile, Unit] =
>       Flow[RequestFile]
>           .map(_.req)
>           .via(connection)
>           .map { res => ResponseFile(res, ????, ????) } //here I don't 
> know how to reference the original RequestFile to get the fileId and 
> fileName
>
>
>
> Has anybody else dealt with this sort of issue?
>
>
>
>
>

-- 
>>>>>>>>>>      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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to