Can I interrupt a worker thread?

Nitrostar nitrostar1 at gmail.com
Fri Aug 13 20:10:39 EDT 2010


Hi,

Can I interrupt a worker thread? What I'm trying to achieve is unnecessary
computation after I've timed out for a given request.

I have a TimerTask on every incoming http request. If it fires, I want to
return an error and kill the current Thread processing that request.

In my setup I have a request object that is constructed in my handler's
messageReceived method. I'm thinking about storing the Thread that's
servicing the request in this object and calling interrupt on it if the
TimerTask expires. I would obviously make sure my TimerTask doesn't fire if
I've already sent a response back.

Thanks,
Nitro
-- 
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Can-I-interrupt-a-worker-thread-tp5422043p5422043.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list