Continue execution after calling Context.ApplicationInstance.CompleteRequest()

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.
 
J

Jimmy [Used-Disks]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top