#1214 Only take pdf that are good for processing
Description
The current code base allows pipeline directory processor to consume "growing pdf". This is due to file copying is not an atomic operation on computer. Pipeline directory processor then process on those pdf, causing exceptions happen.
This PR implements a FileMonitor, providing ability to check if the pdf files are ready for processing. The pipeline directory processor will only consume those pdfs that are ready for processing.
P.S. A pdf is considered to be ready for processing when there is no more entry event (create, modify, delete) after 0.5s.
Closes #1214
Checklist:
- [X] I have read the Contribution Guidelines
- [X] I have performed a self-review of my own code
- [X] I have commented my code, particularly in hard-to-understand areas
- [X] My changes generate no new warnings
Contributor License Agreement
By submitting this pull request, I acknowledge and agree that my contributions will be included in Stirling-PDF and that they can be relicensed in the future under the MPL 2.0 (Mozilla Public License Version 2.0) license.
(This does not change the general open-source nature of Stirling-PDF, simply moving from one license to another license)