Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9242071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:30:14+00:00 2026-06-18T08:30:14+00:00

To help with performance of the clients, I offload the processing of a request

  • 0

To help with performance of the clients, I offload the processing of a request onto a task. This is done because the processing usually takes a bit of time, and I don’t want the clients to be waiting for a while just to get the 200 response. The web service that offloads the work onto a task is always processing posts.

public void ProcessRequest(HttpContext context)
{
    // check for bad requests -- return 400

    // get copy of the context input stream

    Task.Factory.StartNew(() =>
    {
        ProcessRequest(contextInputStreamCopy);
    });
}

private void ProcessRequest(Stream inputStream)
{
    try
    {
        // process input stream
    }
    catch(Exception ex)
    {
        // any server error that would normally result in 500 response are not
        // exposed to the clients, the clients are to see 200 when the server 
        // encounters an error
    }
}

So my question is what happens to these tasks when IIS recycles, or when the web site is being stopped.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T08:30:16+00:00Added an answer on June 18, 2026 at 8:30 am

    When IIS recycles, it waits for all that threads to finish and exits – up to the timeout value that have on pool. After that time out they kills all running threads and start again.

    So you may set a signaling to your threads to stop when the application request to shut down at globa.asax using the Application_End functions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

am trying to squeeze some performance out of this query, any help would be
Help from the SQL Gods Required Table 1 - DistinctQuotes This tables holds information
Help! I think i've gone in a bit over my head. I'm making a
To help explain my question I'll explain a little bit of the problem. We
This is the first time I've used Node.js and Mongo, so please excuse any
I need help with improving the performance of the following SQL query. The database
I just need a little help how to organize my code. This is not
Help me translate following block of the Haskell code. The run function produces text
Help please on how to extract data like 15,Teaching Periods 1 and 2.,Max 150.
Help! I'm using the ASP.Net Login control on a Login page, but the Login

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.