Thread on web method

E

Elementary Penguin

Suppose I spawn a thread from a web method.

The thread runs a process that takes 10 minutes.

The main thread, running the web method, returns a value to the consumer
saying, "message rec'd".

Does the thread continue to process?

Is this any different from an "asynchronous" web service?
 
C

Cor Ligthert

Elementary,

In dotNet it is forever
Ask get answer Ask get answer etc

So I see this as
Ask get answer "I am started wait for answer" that it is not is not
important for your client
Ask and start your process (you have tested if there is connection in your
previous question), and when it is ready give it back.

I don't see as often not any need for a thread in this because all that you
do in the main thread is the proces.

Just my thought,

Cor
 
E

Elementary Penguin

Cor Ligthert wrote:

I don't see as often not any need for a thread in this because all that
you do in the main thread is the proces.

Sorry, Cor, actually this is for a completely different application...I
should have explained.

The situation is:

1) A web service that runs a Sql Server sproc and outputs a text file.
2) The sproc can take up to 10 minutes to run.
3) The consumer of the web service does not need to know if the file is
produced -- it just needs to kick off the process.

So, I thought the web service could:

1) Receive the request.
a. Spawn a thread to run the sproc and output the file

2) Immediately return a response to the consumer that says "message
received". And then the consumer would be released ( not subject to http
timeouts and so on. )
 

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