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