Open w281015308 opened 5 years ago
I gotta ask. What exactly is your use case with this?
Normal operation would not have you killing threads in the context of the server to begin with. But in your scenario you are actually killing threads that below to the thread pool. If you want to terminate the execution and return a response to the caller, then you should either use an async model with a cancellationToken or throw an exception.
I gotta ask. What exactly is your use case with this?
Normal operation would not have you killing threads in the context of the server to begin with. But in your scenario you are actually killing threads that below to the thread pool. If you want to terminate the execution and return a response to the caller, then you should either use an async model with a cancellationToken or throw an exception.
Yes, I really want to terminate the execution. I have a circuit breaker to limit the concurrent request and it is working in another thread. when the threshold value of concurrent request is reached, circuit breaker can not throw an exception in the request thread. so kill the request thread is simple. Cause our scenario is very complex, I have to do that. If I change Nancy code for throwing an exception when the request thread is killed, It is correct or not? Thanks for your reply. :)
Prerequisites
DEBUG
andRELEASE
modeDescription
but the codes I added just for testing. It is not really correct.
System Configuration
Nancy version: latest version
Environment (Operating system, version and so on): windows 10
.NET Framework version: .net 4.5.2