[infinispan-dev] ISPN-2808 - thread pool for incoming message [feedback]
Mircea Markus
mmarkus at redhat.com
Thu Feb 28 12:42:34 EST 2013
On 28 Feb 2013, at 17:30, Pedro Ruivo wrote:
>>>> chain the better.
>>> So do you think that is better to create a new interceptor to dispatch
>>> the commands to the thread pool? (at least for the VisitableCommands).
>>> And put this new interceptor after the InvocationContextInterceptor?
>> we shouldn't create an interceptor yet, perhaps we'll do that with ISPN-2849.
>>>
>>> My opinion, it to dispatch the command to a new thread before invoking
>>> command.perform() in order to avoid to move some ThreadLocal variable,
>>> set by the perform() method.
>> +1
> However I prefer to do this dispatch in CARD to avoid make to code more
> complex and duplicate it. I mean, in CARD we have:
>
> handle() {
> if is from another site
> process from another site
> else
> if is cache rpc command
> inboundInvocationHandler.handle
> else
> command.perform
> }
>
> and if I move the dispatch inside the InbounInvocationHandler, as
> suggested, I will have to duplicate the code for each branch of the IF,
> namelly:
>
> try
> command.perform
> transport.sendResponse
> catch Thowable t
> transport.sendResponse(ExceptionResponse)
>
If it's only for this try-catch duplication then it should be fine.
Cheers,
--
Mircea Markus
Infinispan lead (www.infinispan.org)
More information about the infinispan-dev
mailing list