Netty and HTTP asynchronous responses...

Jay McGaffigan hooligan495 at gmail.com
Tue Dec 15 08:12:59 EST 2009


Thanks for your response Carl!

One question:

> Of course, you need somewhere to keep track of your open requests (channels)
> and dispatch message to all open connections when you receive messages to
> send.

Does netty already have something that would facilitate this?  (Does
something like a channel group but for open requests help support
this? or is a channel group a list of open requests?) Or is it a "roll
your own" type of thing.

Thanks!
Jay


2009/12/12 Carl Byström <cgbystrom at gmail.com>:
> On Tue, Dec 8, 2009 at 5:34 PM, Jay McGaffigan <hooligan495 at gmail.com>
> wrote:
>>
>> ...
>> I guess my question is this... Does Netty have facilities in place
>> already that facilitate the deferred response concept or should I
>> expect that I will have to find a library elsewhere (or roll my own)
>> to achieve this functionality on top of Netty?
>> ...
>
> Sure, that's possible. Netty make a great Comet server.
>
> If you'd like to defer a response while waiting for a message to be sent,
> just don't close the connection.
> See the method writeReponse() in
> http://anonsvn.jboss.org/repos/netty/trunk/src/main/java/org/jboss/netty/example/http/snoop/HttpRequestHandler.java
> At the end the channel is closed. In the HTTP example, one channel is one
> request.
> You can skip the closing part and by doing that you keep the connection
> open.
>
> By default, Netty spawns one I/O thread per processor to take advantage of
> multi-core servers. As long as you don't do any synchronous I/O, you'll be
> fine.
>
> --
> Carl
>
>
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
>
>



More information about the netty-users mailing list