[coldbox-3.5.2] How to limit concurrent operations

Hey, CB Group:

I have a question that I figure someone has run into out there, and knows the solution running under a ColdBox (3.5.2) environment.

We are working on a system that will be comprised of a combination of RESTful services and scheduled jobs (that will run under the ColdFusion scheduler). The application will take care of replicating documents, in a hub and spoke architecture, between a myriad of systems.

Each system will run a CF scheduled task that will perform a check on any replication that needs to be performed, uploading and downloading large files as necessary. As a result, the scheduled task can run from a few seconds to several minutes.

It is critically important that another instance of the scheduled task NOT start if a previous instance is still running. I’ve done this in other environments before, where the application maintains a state flag, with a timeout, that indicates another process is currently running. In such a case, the new task simply terminates gracefully, and things are fine.

In the ColdBox world, is there a recommended scope to track such concurrency? Although I realize I “could” create an application variable structure to store the process information, I curious if there is a better way.

Cheers!

Kevin S. Anderson

INDURE Team Software Engineer

image001.jpgIntelligent Software Solutions Inc.

Global Enterprise Solutions Division

Phone: 719.452.7456 | Cell: 719.930.2599

Email: kevin.anderson@issinc.com