thanks I ll check this out! I ve somehow overlooked it in documentation

On Tuesday, 8 September 2015 13:27:11 UTC+2, Akka Team wrote:
>
> Hi Pawel,
>
> Instead of Iterable and mapConcat you can use map, and 
> flatten(FlattenStrategy.concat).
>
> For example:
>
>   inputs.map { in => sourceFor(in) }.flatten(FlattenStrategy.concat)
>
> I have written some TCP examples for an older ML thread, they might help 
> to give you some inspiration: 
> https://gist.github.com/drewhk/25bf7472db04b5699b80
>
> (try to run them to see what they do)
>
> -Endre
>
> On Sun, Sep 6, 2015 at 7:36 PM, paweł kamiński <[email protected] 
> <javascript:>> wrote:
>
>> hi,
>> I have a problem with defining a flow that reacts to incoming data and 
>> producing dynamic response.
>>
>> lets say I have a tcp server
>>
>> Tcp
>>         .get(system)
>>         .bind(host, port)
>>         .to(foreach(con -> {
>>             con.handleWith(handlerFlow, materializer);
>>         }))
>>         .run(materializer);
>>
>>
>> now the handler flow is something like
>>
>>
>> Flow<ByteString, ByteString, BoxedUnit> handler = Flow.of(ByteString.class)
>>         .via(Framing.delimiter(delimiter, maximumFrameLength, false))
>>         .map(incoming -> {
>>             *???? decode - read data - start producing response data based 
>> on read data.*
>>         })
>>         .map(outgoing -> outgoing.concat(delimiter));
>>
>>
>> now I would like to produce variable number of events as response. 
>>
>> mapConcat would be a good choice but it is required to return Iterable 
>> object rather than some kind of source, producer or stream. 
>>
>>
>> I tried to work with flow's factories and use Zip or Concat but they became 
>> immutable once constructed.
>>
>>
>> the scenario would be to response with different binary files based on 
>> incoming data over single connection.
>>
>>
>> thanks for help and clarifying 
>>
>> -- 
>> >>>>>>>>>> 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 [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <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 - Reactive apps on the JVM
> 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 [email protected].
To post to this group, send email to [email protected].
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