Sure, i am using a library called file-queue (which tbh i only audited very roughly) where i'm reading the downloadable items from the queue using `tpop` (transactional pop) .. file-queue uses a maildir structure with a 'tmp', 'cur', 'new' path, to get new data from the queue the 'cur' path is used, during a pop "transaction" the file is moved into the 'cur' directory, once it is committed it is deleted, when an error happens it will be reverted into the 'new' directory.
From my code: https://github.com/hpoul/alfred-openclipart/blob/master/lib/QueueWorker.js#L20-L31 (tpop makes it imediately invisible for all other download processes), ie "locked"
From file-queue documentation: https://github.com/threez/file-queue#transactional-popping
From file-queue implementation: https://github.com/threez/file-queue/blob/master/lib/maildir.js#L115-L139 "this.fs.rename(newPath, curPath," (file-queue tpop (https://github.com/threez/file-queue/blob/master/queue.js#L57) uses tryPop (https://github.com/threez/file-queue/blob/master/queue.js#L76) which calls maildir#process
Hope that makes sense..