long process

  • Thread starter Thread starter Peter Kirk
  • Start date Start date
P

Peter Kirk

Hi

I have an asp with a single button. This invokes a method in one of my
classes which performs a terribly long process - can take 15 or 20 minutes.
What is the best way to handle this sort of situation? If I just call my
long method then the browser eventually times out. Can I start a thread
instead, and return immediately to the browser (or does the thread die
almost immediately when the button handling ends and the response is sent to
the browser)?


Thanks,
Peter
 
Hi Peter,
Yes .net provides you provision for this. You can do it by using
Asynchronous call. .Net provides you AsyncDelegate to call method which you
want to call asynchronously. .Net works on the asynchronous pattern which is
flexible and you dont require to write additional Code in called method. When
the method will complete it will return result through of IAsyncResult. I
cant explain whole working of asynchronous here, but if you need details , I
can provide you links.
 
Hi,


Altaf Al-Amin Najwani said:
Hi Peter,
Yes .net provides you provision for this. You can do it by using
Asynchronous call. .Net provides you AsyncDelegate to call method which
you
want to call asynchronously. .Net works on the asynchronous pattern which
is
flexible and you dont require to write additional Code in called method.
When
the method will complete it will return result through of IAsyncResult. I
cant explain whole working of asynchronous here, but if you need details ,
I
can provide you links.


But as this is a asp.net app the page will be long gone and when the method
return there will be no process waiting for the answer.
 
Hi,

There are several solutions, creating a thread is one, alternative you can
use MSMQ.

The kit of the question is how to inform the user his work was completed.
If an email a good enough answer?
 

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

Back
Top