Polling

I have an app which processes bank statements, which arrive every 5 minutes or so into a specified folder. Thus I need to check every 5 minutes whether new statements have arrived.I can think of a few ways of doing this, maybe using C$Sleep running as a thread and one or two others, but since this is the first time I am doing this, I dont want to waste time experimenting if someone out there has already come up with the best solution, I am sure some of the forum members have done this before, so would welcome you advice on the best method.

  • In this instance with the poll time being more than a minute, I personally use a cron job to call a script to check for the files in the specified folder, and then, I call my program if the files exist. This avoids tying up a runtime license for us. We have a few programs that poll every few seconds which would be inappropriate for a cron job.

  • In this instance with the poll time being more than a minute, I personally use a cron job to call a script to check for the files in the specified folder, and then, I call my program if the files exist. This avoids tying up a runtime license for us. We have a few programs that poll every few seconds which would be inappropriate for a cron job.

  • Thanks very much, my app is slightly different, in that a number of users are interfacing with the app all day, so it is active all the time, but must still check for new bank statements every 5 minutes and if found, process the statements and refresh the user screens with the latest information. For that reason I was thinking of running the polling as a thread with a sleep time .  

  • Thanks very much, my app is slightly different, in that a number of users are interfacing with the app all day, so it is active all the time, but must still check for new bank statements every 5 minutes and if found, process the statements and refresh the user screens with the latest information. For that reason I was thinking of running the polling as a thread with a sleep time .