"Long running" handlers

Virat Gohil virat.gohil at gmail.com
Sat Mar 6 12:29:05 EST 2010


On Sat, Mar 6, 2010 at 10:39 PM, infectedrhytms <infectedrhythms at hotmail.com
> wrote:

>
> Ok the MemoryAwareThreadPoolExecutor seems to do the trick. Thanks I think
> I
> may right up a simple example cause there is now way I would have figured
> this out.
>
> Just to be clear. Cause I'm still trying to gasp this Chanels, Events
> etc...
> thing...
>
> With MemoryAwareThreadPoolExecutor will any event fired off in one instance
> of MyBusinessHandler() affect the instance of another one. So if I have 3
> threads running 3 separate instances of MyBusinessHandler, what ever
> happens
> in one will not affect the other right, only the order of the execution may
> not be the same which is fine because who ever finishes faster the better?
>
> So for instance a close event in 1 BusinessHandler will not affect the
> other
> 2?
> --
>

You are correct that when using MemoryAwareThreadPoolExecutor or
OrderedMemoryAware..., your messages from different channels will not affect
the results (functionally) of the other channels. However, you have to be
careful while using MemoryAwareThreadPoolExecutor, as it does not guarantee
that the message from a single channel will be raised in the same order that
they were received in. Have a look at :
http://www.jboss.org/file-access/default/members/netty/freezone/api/3.1/org/jboss/netty/handler/execution/OrderedMemoryAwareThreadPoolExecutor.htmlbefore
proceeding.

HTH,

Virat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/netty-users/attachments/20100306/b3569748/attachment.html 


More information about the netty-users mailing list