Thanks for the quick response, I'll look for FlattenStrategy.merge in 
future releases.

On Friday, February 6, 2015 at 6:00:06 AM UTC-5, Akka Team wrote:
>
> Hi Paul,
>
> On Thu, Feb 5, 2015 at 10:50 PM, Paul Kinsky <pki...@gmail.com 
> <javascript:>> wrote:
>
>> I would like to flatten a Source[Source[T]] opportunistically, emitting 
>> elements of type T as they arrive from any of the inner Sources. This is 
>> conceptually similar to a merge vertex 
>> <http://doc.akka.io/api/akka-stream-and-http-experimental/1.0-M2/index.html#akka.stream.scaladsl.Merge>,
>>  
>> with the added ability to add new input Sources on the fly. I would like to 
>> use the flatten method as defined on Source[T] 
>> <http://doc.akka.io/api/akka-stream-and-http-experimental/1.0-M2/index.html#akka.stream.scaladsl.Source>
>>  
>> to do this, but currently the only FlattenStrategy available is Concat, 
>> which, to quote the comments in FlattenStrategy.scala 
>> <https://github.com/akka/akka/blob/release-2.3-dev/akka-stream/src/main/scala/akka/stream/FlattenStrategy.scala>
>> : 
>>  
>>
>>> * Strategy that flattens a stream of streams by concatenating them. This 
>>> means taking an incoming stream
>>> * emitting its elements directly to the output until it completes and 
>>> then taking the next stream. This has the
>>> * consequence that *if one of the input stream is infinite, no other 
>>> streams after that will be consumed from*.
>>
>>
>>
> There is a ticket for this missing strategy that will be called 
> FlattenStrategy.merge. This strategy will be in 1.0 latest.
>  
>
>> Since the class it extends, abstract class FlattenStrategy[-T, U], has no 
>> abstract methods, I assume there's no way to create custom flatten 
>> strategies. 
>>
>
> Yes, unfortunately it is not easy to write a good and safe dsl for 
> flattening yet, so this was not yet pursued. We will provide a few built-in 
> strategies in the beginning, hopefully we can add the possibility for 
> customization later.
>
> -Endre
>  
>
>>
>> How would you recommend writing an opportunistic flatten step?
>>
>> -- 
>> >>>>>>>>>> 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+...@googlegroups.com <javascript:>.
>> To post to this group, send email to akka...@googlegroups.com 
>> <javascript:>.
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Akka Team
> Typesafe - The software stack for applications that scale
> Blog: letitcrash.com
> Twitter: @akkateam
>  

-- 
>>>>>>>>>>      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