MCPcopy Create free account
hub / github.com/chhoumann/MetaEdit / enqueueFileWrite

Method enqueueFileWrite

src/metaController.ts:858–873  ·  view source on GitHub ↗
(file: TFile, task: () => Promise<T>)

Source from the content-addressed store, hash-verified

856 }
857
858 private async enqueueFileWrite<T>(file: TFile, task: () => Promise<T>): Promise<T> {
859 const key = normalizePath(file.path);
860 const previous = fileWriteQueues.get(key) ?? Promise.resolve();
861 const queued = previous.catch(() => undefined).then(task);
862
863 fileWriteQueues.set(key, queued);
864
865 try {
866 return await queued;
867 }
868 finally {
869 if (fileWriteQueues.get(key) === queued) {
870 fileWriteQueues.delete(key);
871 }
872 }
873 }
874}

Callers 10

addYamlPropMethod · 0.95
appendDataviewFieldMethod · 0.95
deletePropertyMethod · 0.95
updatePropertyInFileMethod · 0.95
updateMultipleInFileMethod · 0.95
updateYamlPathMethod · 0.95
addOrUpdateYamlPathMethod · 0.95

Calls 4

normalizePathFunction · 0.90
getMethod · 0.80
setMethod · 0.80
deleteMethod · 0.80

Tested by

no test coverage detected