[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Set the time out limited



   Hi Scott
   You have given me food for thought.  Well at less I know more about how
   the HTTPAPI works.  Is there a manual I can get to read up more about
   it?  Thanks for your suggestions now its up to us, to plan a way
   forward.
   Enjoy
   Devlyn
   From:        Scott Klement <sk@xxxxxxxxxxxxxxxx>
   To:        HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
   Date:        2012/11/21 08:13 AM
   Subject:        Re: Set the time out limited
   Sent by:        ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
     __________________________________________________________________

   Hi Devlyn,
   It's true that HTTPAPI will not time out if you send a byte every 30
   seconds or so.   However, you could also set the timeout value in
   HTTPAPI to be more than 20 minutes if you want to wait for your service
   to run that long.  So, this is also possible.
   With most web service servers that I've worked with, it'd be impossible
   to return a byte every 30 seconds, because the server software will do
   some level of caching.  But, if you're writing/running your own web
   services, you may have options available that the average web services
   server does not?  I don't know.
   Here's what I've seen others do for a long-running web service... they
   split it into multiple calls.   One call to initiate the service, and a
   separate call (or call-back) to check the status of the server, and if
   complete, return the result.
   So in a polling scenario (this is popular when AJAX is involved, since
   AJAX has no way to handle a call-back):
   1) You have one web service that starts a background job.  It checks
   that the parameters are valid, and then "submits a job" (or equivalent)
   to run in the background.  It returns back to the caller immediately
   (or
   very quickly) and simply say "success: the process has begun" or
   "failure: bad parameter" or whatever.
   2) A second web service call checks the status of the server.   If the
   background job is still running, it returns "still running.. try again
   later".   When this is returned, the caller delays for 30 seconds or
   so,
   and then calls it again.  If the process has completed, then it returns
   the result.   Or, if the process failed, it returns an error.
   In a call-back scenario:
   1) Same as #1, above.  Just starts the job.
   2) On the server side, when the background job completes, the
   background
   job calls a web service on the computer of whomever initiated the job
   (in step 1) and notifies them that the job completed, and sends them
   the
   result.
   So these are the techniques I've seen people use -- but for HTTPAPI's
   part, it's capable of working with a 20 minute timeout if you prefer.
   Just replace 'HTTP_TIMEOUT' on your http_url_post() call with the
   number
   of seconds you want.  20 minutes is 1200 seconds.  30 minutes is 1800
   seconds, etc.
     __________________________________________________________________

   This e-mail is subject to the Columbus Stainless [Pty] Ltd Email Legal
   Notices available at:
   [1]http://www.columbus.co.za/EmailLegalNotice.htm.
     __________________________________________________________________

   This e-mail message has been scanned for Viruses and Content and
   cleared by MailMarshal
     __________________________________________________________________

References

   1. http://www.columbus.co.za/EmailLegalNotice.htm
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------