Question about whare to put bussines logic

"Trustin Lee (이희승)" trustin at gmail.com
Thu Apr 29 05:26:03 EDT 2010


Hi Srini,

If the business logic takes longer time, then you can handle the
received events in a separate thread pool.  You could use
OrderedMemoryAwareThreadPool and ExecutionHandler for instance.  You
might want to use other executor implementation depending on your needs.

HTH,
Trustin

Srini Palthepu wrote:
> Hi
> 
> I am in the process of re-factoring an existing Java server that uses old IO
> to Netty framework. I have gone through the examples and have basic
> understanding of the event based architecture. As I understand, the most/all
> of the logic of application essentially goes into the hanlders such as
> messageRecieved() after doing all the protocol decoding using
> encoder/decoder. My question is what if the processing takes more time to
> accomplish? Does it not block the thread in the handler's messageRecieved()? 
> I see all the examples are designed in a way where reading and processing
> and writing back are all are done in the same routine in one thread. I am
> assuming that if processing takes lot of time, then I need to place the data
> rec'd and the channel reference into some global map and hand it to other
> worker threads in a separate pool. The worker thread when finished the
> processing will write the reply to the channel. Am I thinking right or
> missing something.
> 
> thanks for any help
> Srini
> 

-- 
what we call human nature in actuality is human habit
http://gleamynode.net/


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
Url : http://lists.jboss.org/pipermail/netty-users/attachments/20100429/8033a92e/attachment-0001.bin 


More information about the netty-users mailing list