-
1. Re: is the directory watcher multi-threaded once it calls the cfc?
BKBK Mar 4, 2014 2:56 AM (in response to casey w)Yes, the directory-watcher runs in a single thread. However, the question whether or not "all 3 files run one at a time" is irrelevant. It is the directory-watcher that runs.
When the watcher runs, ColdFusion records the current state of the directory. The watcher then sleeps for the duration of the interval. The interval is, by default, 60 seconds. When the watcher re-awakes, it compares the present state of the directory with the saved state. It then knows - at once, during the same single thread - which files have been added, deleted or changed.
-
2. Re: is the directory watcher multi-threaded once it calls the cfc?
casey w Mar 4, 2014 5:44 AM (in response to BKBK)Maybe i didn't word the question correctly, but i'm not asking if the directory watcher itself is multi-threaded, which is what you describe. I'm asking when it calls the cfc, are the calls to the cfc multi-threaded? So again my example, if there are 3 files that the directory watcher finds, then the cfc has to be called 3 times correct? So are those 3 calls to the cfc multi-threaded and can run simultaneously, or do those 3 calls to the cfc have to run one at a time in the order the files came in?
-
3. Re: is the directory watcher multi-threaded once it calls the cfc?
BKBK Mar 4, 2014 10:39 AM (in response to casey w)I think I understood your questions. There were more than one, some implicit. Here are my answers:
- ColdFusion runs the directory-watcher in a single thread.
- During the execution of the same thread, ColdFusion detects whether of not a file has, or any number of files have, been added, deleted or changed.
- When ColdFusion calls the CFC, it does so in that same single thread. My guess is that any file add-events, delete-events and change-events are queued and handled one after the other.