Continue execution after calling Context.ApplicationInstance.CompleteRequest()

  • Thread starter Thread starter Saby
  • Start date Start date
S

Saby

We have a requirement where we need some kind of asynchronous behavior
in an ASPX page.

The page receives a POST request from a client and it needs to
immediately respond back to the client with a custom acknowledgement
message and release control of the client http pipeline.

The aspx page then needs to continue doing some processing (long
running transaction). The client does not care about this processing.

We are achieving this by calling
Context.ApplicationInstance.CompleteRequest() after doing a
Response.Write() of the acknowledgement message and before the
starting the long running transaction. Our assumtion was that this
would release the client thread. But the behavior is different. The
client (IE in this case) waits till the long running transaction is
complete.

What am I missing?
I cannot use Response.Write() since it terminates the thread with a
thread aborting exception.

Any ideas of a quick and dirty way of implementing this without
getting fancy with a queued asynchronous implementation.
 
The page receives a POST request from a client and it needs to
immediately respond back to the client with a custom acknowledgement
message and release control of the client http pipeline.

Do the long processing in a seperate thread.
 
Back
Top