Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2008

Tip: Looking for answers? Try searching our database.

a timed event in asp.net

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Larry Bud - 13 Feb 2008 16:39 GMT
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?
Peter Bromberg [C# MVP] - 13 Feb 2008 17:28 GMT
Larry,
This article shows how you can use  a timer in the Global class of a web
application. It's not exactly the same thing you are asking for, but it's
close enough to be of use:

http://www.eggheadcafe.com/tutorials/aspnet/223319d8-6366-492a-8eae-e3c7a26c88a4
/refreshing-aspnet--cache.aspx

-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com 

> With the help of some of you guys, we're making progress here.
>
[quoted text clipped - 12 lines]
> is done?   I can obviously take current time, but is there other timer
> functions that I should use?
bruce barker - 13 Feb 2008 17:43 GMT
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)

> With the help of some of you guys, we're making progress here.
>
[quoted text clipped - 12 lines]
> is done?   I can obviously take current time, but is there other timer
> functions that I should use?
Patrice - 13 Feb 2008 17:50 GMT
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

--
Patrice

> With the help of some of you guys, we're making progress here.
>
[quoted text clipped - 12 lines]
> is done?   I can obviously take current time, but is there other timer
> functions that I should use?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.