Web Connection
wwEvalTimer question
Gravatar is a globally recognized avatar based on your email address. wwEvalTimer question
  Ron Jasper
  All
  Feb 20, 2026 @ 12:09pm

Hi Rick, Hope you're doing well this chilly day in February (at least chilly here on the west coast of Canada). My Web Connection server has been running incredibly reliably for over a year now, with very few issues, almost none. I now have a pressing need to pick up and process json files that are deposited with a "save-and-go" function within Web Connection. I need another Web Connection function to process the files once they are saved on the server, but this cannot tie up the original Web Connection function that saved them. The reason I need this to be done by Web Connection is because Web Connection will map the server drives, using its utility to do so, and can run without being logged in to the server as a user. The drive mappings are critical to updating other data on the local network that the Web Connection is part of. Can I use the wwEvalTimer to do this? "This" being scan the folder for any json files and process them if found. A regular foxpro timer-based program will not support the drive mappings, try as I might, the system security requires a user to be logged in. Web Connection gets around this requirement when it starts up, the mapping is established. Thanks again, as always, for your help.

Gravatar is a globally recognized avatar based on your email address. re: wwEvalTimer question
  Rick Strahl
  Ron Jasper
  Feb 20, 2026 @ 03:21pm

Sure that would work...

... but make sure you have some way to ensure that you keep track of whether tasks were run or not or failed as for timer based events there's potential that it doesn't work. Whatever you do in the timer routine make sure it runs quickly or else offload it.

What I would do:

  • Use wwEvalTimer to fire an Http POST request to Web Connection with the actual task to process
  • Either pass the data or a link reference to the data needed for processing in the POST as JSON
  • Set up a Web Connection request to process this operation

Why all this? This ensures that any lenghty processing doesn't occur on a timer thread that might be interfering with the regular Web Connection processing. By offloading the timer to a Web Conenction request you get a regular request that is running like 'normal'.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: wwEvalTimer question
  Ron Jasper
  Rick Strahl
  Feb 20, 2026 @ 04:31pm

Thanks Rick, Am I correct in thinking I would write the timer httppost as a foxpro program external from webconnection to make the call to Web Connection?

Gravatar is a globally recognized avatar based on your email address. re: wwEvalTimer question
  Ron Jasper
  Rick Strahl
  Feb 20, 2026 @ 04:35pm

I need the wwEvalTimer process to run in an exe setup on Windows Task Scheduler as a SYSTEM process so that there is no login required. I've done this to update SQL Server data every five minutes on weekdays between 7:00 am and 7:00 pm and it has ran reliably for well over a year. So again, I'm guessing I'd make a POST request to a Web Connection function to initiate the data update, I think that's right?

Gravatar is a globally recognized avatar based on your email address. re: wwEvalTimer question
  Ron Jasper
  Ron Jasper
  Feb 20, 2026 @ 04:51pm

Also, one other consideration. Should I use wwDotNetBridge and the Windows FileSystemWatcher to check if the files are in the directory in realtime, rather than use a timer. Or is that overkill? If not, can you please point me in the right direction to figure out how to do that, thanks again.

Gravatar is a globally recognized avatar based on your email address. re: wwEvalTimer question
  Ron Jasper
  Rick Strahl
  Feb 21, 2026 @ 05:59am

Hi again Rick,

Is there any reason why I could not accomplish the same thing, possibly better than a timer, by using wwDotNetBridge and System.IO.FileSystemWatcher? I'm thinking it would provide real-time awareness of any json files saved into the targeted directory and then run the http post to Web Connection to process them, if there are any files.

Gravatar is a globally recognized avatar based on your email address. re: wwEvalTimer question
  Rick Strahl
  Ron Jasper
  Feb 21, 2026 @ 10:56am

Yes but with that you have to be even more careful since it's multi-threaded code calling back into FoxPro interrupting executing FoxPro code. You need to offload the processing immediately. Same rules basically apply unless you launch an external application from FoxPro - which you can and in the same user context as the server. IOW - use the web connection app to pick up the files, then run a separate program to handle the processing.

Or - if the process is quick enough generate an Http request that triggers a regular Web Connection request that can process the task in normal FoxPro program flow.

+++ Rick ---

© 1996-2026