Thread on web method

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Elementary Penguin

    Thread on web method


    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 "asynchrono us" web service?

    --
    Texeme


  • Cor Ligthert

    #2
    Re: Thread on web method

    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


    Comment

    • Elementary Penguin

      #3
      Re: Thread on web method

      Cor Ligthert wrote:

      [color=blue]
      > 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.[/color]

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


      --
      Texeme


      Comment

      Working...