I work for a operational ocean observatory and we have been deploying autonomous underwater vehicles (AUV) which patrol the world's oceans and periodically call in to a central server in our lab over a satellite communication link to transfer data files. I've been running a variety of scripts on my crontab at roughly 5 minute intervals to process this data and display it on the web; however, the AUV calls in about once every 6 hours, so the cronjob spacing is a bit of overkill, but required to minimize the time between file transfer and processing.
Each time the AUV calls in, a new log file is created and written to, so what I'd like to do is set up a kind of event handler that will watch the log directory and trigger a set of callbacks to perform a variety of tasks.
While I have not used them, I'm aware of the following to handle asynchronous events:
Event.pm
Event::Lib
POE
As a relative newbie to Perl, what I'd like are some suggestions that allow me to accomplish the following:
1. Get something up and running quickly.
2. The flexibility to expand once I become familiar with the module.
All suggestions appreciated.
UPDATE: Sorry, I was a bit unclear here and left something out:
1. We do have a number of AUVs that could be simultaneously deployed.
2. The AUV can be programmed to surface and call in at a number of preset intervals. Currently, we are using 6hrs as the interval, but this definetely can vary. For example, if the satellite link is down, the AUV is also programmed to call in when it gets a good link.
I should rephrase and say that I'm not sure when the AUVs will call in, which is what I mean by asynchronous.
The processing does NOT take more than 6hours, but, in the future, I'd like to have the ability to retask the AUV depending on the data that comes in. Since the satellite comm link can only occur when the glider is on the surface, the retasking needs to occur immediately when the AUV connects.
Also, the AUVs are deployed for upto 2 months at a time, so the application needs to run for the duration without interfering with other processes.
Sorry for the confusion.
In reply to Handling asynchronous events with Perl by njcodewarrior
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |