Hi,

On the client side I have a datasource and I want to send it remotely to 
other server via TCP for further processing. I will take a simple example 
to demonstrate it:

client side:

val testInput = ('a' to 'z').map(ByteString(_))

val result = Source.cycle(() => testInput.iterator)
  .throttle(1, 1.second, 1, ThrottleMode.shaping)
  .via(Tcp().outgoingConnection(address, port))
  .runWith(Sink.ignore)


basically; i have an infinite datasource and i want to send to another server 
for further processing and i want *back-pressure.*


server side:

a normal way to handle connection in server side is like that one:

val handler = Sink.foreach[Tcp.IncomingConnection] { conn =>
  conn handleWith *CUSTOM_FLOW*
}

val connections = Tcp().bind(address, port)
val binding = connections.to(handler).run()




What i want is to RESTORE the same source Source.cycle(() => ('a' to 
'z').map(ByteString(_)).iterator) on remote server; so that I can plug the 
source in some predefined GraphDSL. 

My question is how i can create a Source[String, NotUsed] from CUSTOM_FLOW?


Is the above code "back-pressure". I am quite confused because the akka IO 
example: http://doc.akka.io/docs/akka/2.4.12/scala/io-tcp.html; ACK-Based Write 
Back-Pressure section seems to be much more complicated.


Could you please suggest what is correct way (or most recommended way) to PIPE 
a reactive source from machine to another machine and make sure back-pressure?

Thank a lot.


PS: my use case is: S1 -> broadcast to -> (Flow1, Flow2, Flow3); I want to pipe 
Flow1 => remoteVM1's Source1; Flow2 => remoteVM2's Source2; Flow3 => 
RemoveVM3's source3 while maintaining back-pressure. 

Is this possible with above approach? 




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

Reply via email to