Hi, I'm not sure how using protobuf forces you to communicate in a blocking manner. I'm also using it but over akka.io, which is modeled as actors, so it's completely non blocking and works in exactly the same way as the rest of my application does.
On Tuesday, September 2, 2014 11:44:27 AM UTC+3, Andy Bean wrote: > > I'm new to akka and have a problem when handling blocking IO. I need to > integrate the protobuf library that is reading/writing data using standard > java InputStream/OutputStream in a blocking way. > > In my case I open a network connection using a SocketChannel and create an > InputStream and an OutputStream from it. Now I need to read and write data > concurrently. My first approach was to have a Future for reading data in an > blocking way and sending it to the enclosing actors. Writing is done in a > separate actor. When I receive an error I can only stop the writer but not > the reader. > > My structure: > > class Handler extends Actor { > val reader: Future > val writer: ActorRef > } > > I'm a bit lost now because I need to handle connection failures and > reconnect on errors. What would be the best way to handle my situation? > > Greetings, > Andy > -- >>>>>>>>>> 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.