I have a webservice that will be called by a nightly job process documents, each document will be queued and executed on it's own background processor. This process can take a couple hours or a few munites depending on the load. I don't want to have it alive if it's not doing anything. But when a spawn a thread and return immediately the idle clock begins even though there is a thread working. i have not set the thread to IsBackground and it still terminates for being idle. For my test i set the idle time to be 1 minute. Is there a way to keep the service as being "ALIVE"
Here is the webservice code:
public class LetterInitiateWS : System.Web.Services.WebService
{
private static Processor processor = new Processor();
[WebMethod]
public void ExecuteBulkRun()
{
var thrd = new Thread(() => ThreadExecuteBulkRun());
thrd.IsBackground = false;
thrd.Start();
}
private void ThreadExecuteBulkRun()
{
processor.ExecutBulkRun();
}
}