Created
February 19, 2015 12:44
-
-
Save linead/198bd705549ec1b68768 to your computer and use it in GitHub Desktop.
Netty Socket Client
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have a server Foo, that I connect to via a simple socket. I write text into the socket to send it messages and it replies with a response to my query once it's processed it, however it makes no guarantee of the order of responses. I can link up requests and responses with IDs. | |
Ex : | |
Send "1:request" to Foo | |
Foo Returns "1:response | |
Send "1:request" & "2:request" to Foo | |
Foo Returns "2:response" | |
10 seconds later | |
Foo Returns "1:response" | |
Question: | |
What's the best way to handle this situation with netty, how can I provide an interface that allows me to submit a message to the Foo service and give me a Promise or a Future that allows me to return without blocking waiting for the response to my message (but knowing i have an object that I can block on later) | |
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks Trustin
I did hesitate from posting this on stack overflow because I felt it might be a bit general, posted now. - http://stackoverflow.com/questions/28628023/asynchronous-application-design-with-netty