Synchronous Mutliplexing in netty
"이희승 (Trustin Lee)"
trustin at gmail.com
Tue Jul 14 01:31:00 EDT 2009
Hi Rahul,
I'm not sure what exactly 'synchronous multiplexed calls' mean in this
context. Could you elaborate with me on what exactly you are trying to
achieve?
Thanks,
Trustin
On 07/14/2009 01:17 PM, Rahul Patil wrote:
> Hi All,
> After evaluating few NIO frameworks we settled on netty owing to its
> flexible and comprehensive architechture. Now I am struggling with a way to
> use netty for synchronous mulitiplexed calls. Following the factorial
> example I have been able to address the synchronous part using the following
> code:
> public Message getMessage(long workID)
> {
> while (true)
> {
> try
> {
> Message am = queue.take();
> if(am.getWorkID() == workID){
> return am;
> }
> else
> {
> queue.offer(am);
> }
> }
> catch (InterruptedException e)
> {
> // Ignore.
> }
> }
> }
> I cannot do a peek as the queue can contain more objects so I need to use
> take and offer.
> What essentially follows then is to make it multiplexed as we need to make
> multiple calls over the same channel to avoid the overhead of using blocking
> queue.
> I looked at some other pose in this forum and came across LocalChannel.
> However, I am not clear about the rationale behind it and not sure how it
> can be used for multiplexing.
> I ran into xsockets while searching for multiplexing and wondered why this
> feature is lacking in netty.
> Considering the benefits of netty I don't want to switch to xsocket but I am
> stuck with this issue which is hindering our project.
> Any help in this matter would be highly appreciated.
More information about the netty-users
mailing list