a timed event in asp.net

L

Larry Bud

With the help of some of you guys, we're making progress here.

I have a webservice that outputs a file which another apps picks up.
I write a row to SQL that has some status flags of this output file.

The other apps processes this file, and will set the status in one of
the columns to true when the output file IT created is ready.

So in my webservice, I want to check every, oh, maybe 1/2 sec to see
when the processing app is done. However, I want to time out after
about 10 seconds.

What's the best way to do a loop that will execute a function, but
only execute this function until it returns TRUE or the elapsed time
is done? I can obviously take current time, but is there other timer
functions that I should use?
 
B

bruce barker

there are two approaches

1) check the timeout/cancel flag. this is easy if there is a loop, less if
not. this approach is also difficult if there are calls to code that may not
return in the timeout.

2) use a watchdog thread. this is a second thread that starts a timer, and
aborts the processing thread if not completed in time. at completion the
process thread would cancel the watchdog. this makes the processing thread
easy to code, but the watchdog takes a little work.

you have a trival polling loop, so I'd do #1. with a little work, you could
have one polling thread that does the work for all concurrent requests.

-- bruce (sqlwork.com)
 
P

Patrice

I'm not really sure to understand the overall process but I would just
notify the webservice using another call :
- the "other app" calls the webservice to get a file
- the "other app" process this file to create a "processed file" (at a
location that is shared with the web service ?)
- the "other app" calls the same webservice to notify the webservice that
the "processed file" is ready
 

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

Members online

No members online now.

Forum statistics

Threads
474,001
Messages
2,570,251
Members
46,849
Latest member
SabaaKhaan

Latest Threads

Top