Async Client with Callbacks

mikewied mikewied at comcast.net
Thu Jun 23 03:54:31 EDT 2011


I am trying to write an http client as follows. I would like be able to
create HTTP responses and then send them through a netty Channel
asynchronously. I then want to have a callback function that is called when
netty has received and processed a response. In my user thread I would be
able to access a future to get the response from the server (and have a
timeout if it takes too long). I am very familiar with java nio and I am
being tripped up with netty because it seems that there is not a way to
select on a channel. As a result I am not able to decide which http response
corresponds with the request I sent. I have been looking at the netty
documentation as well as other projects for a while and I haven't seen
anyone accomplish this. I also looked at the project by ning which
implements an asynchronous http client and I must admit that at first glance
the code looked somewhat confusing. I also son't really want something as
complex as that. I just want something simple. Does anyone have any insight
on how to add callbacks to requests in netty?

--
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Async-Client-with-Callbacks-tp6507468p6507468.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list