I may have misunderstood what you're trying to do but I think you can 
probably use expand for this. In builder pseudocode, something like:

Flow ~> Unzip ~> <the processing you need producing n items> ~> Zip
              ~> Flow.expand(Iterator.continually(_))        ~> 

The expand step will duplicate the last element it received which means 
it's always available for the zip step.

Julian


On Wednesday, May 10, 2017 at 12:43:41 AM UTC+1, ben fleis wrote:
>
> Hi,
>
> I am new to akka streams, and working on a project having both real-time 
> and batch needs. In the batch cases, I need to take context (e.g., 
> requestID), from the initial request, and apply it at the end of batch-item 
> processing. The batch-item subflow is by itself rather simple: (parse, 
> mapConcat, transform).  The item transforms comes from the real-time 
> context.
>
> It is the folding into an output format that is less obvious. That code 
> needs the request ID and other context from the original request to 
> generate an output byte stream.
>
> What I want to do is treat the context and input bytes as a tuple, unzip 
> them in the beginning, zip them at the fold stage. I need to understand 
> how to map each input byte stream into a sequence of stream elements in a 
> sub-flow, and fold each subsequence in its natural grouping.
>
> mapConcat flattens, thus dropping the boundaries between adjacent batch 
> requests.
>
> I could use map, and materialize a new stream within each batch handler 
> for its items, and send the folded result as the output of the flow... but 
> that seems strange, and likely to be already available. (Especially since 
> GroupBy and SubFlow seem closely related...)
>
> Does this exist?
>
> Thanks,
>
> b
>
>

-- 
>>>>>>>>>>      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 https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to