@componentor/fs 2.0.9 → 2.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -19
- package/dist/index.cjs +9 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -13
- package/dist/index.js.map +1 -1
- package/dist/kernel.js +1 -15
- package/dist/kernel.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -946,23 +946,19 @@ async function handleMessage(msg) {
|
|
|
946
946
|
}
|
|
947
947
|
}
|
|
948
948
|
|
|
949
|
-
// Process queued messages
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
let activeOperations = 0;
|
|
953
|
-
|
|
954
|
-
async function processQueue() {
|
|
955
|
-
while (messageQueue.length > 0 && activeOperations < MAX_CONCURRENT) {
|
|
949
|
+
// Process queued messages after ready
|
|
950
|
+
function processQueue() {
|
|
951
|
+
while (messageQueue.length > 0) {
|
|
956
952
|
const msg = messageQueue.shift();
|
|
957
|
-
|
|
958
|
-
handleMessage(msg).finally(() => {
|
|
959
|
-
activeOperations--;
|
|
960
|
-
processQueue(); // Process next queued message
|
|
961
|
-
});
|
|
953
|
+
handleMessage(msg); // Process concurrently - don't wait
|
|
962
954
|
}
|
|
963
955
|
}
|
|
964
956
|
|
|
965
|
-
//
|
|
957
|
+
// Handle messages concurrently - each operation proceeds independently
|
|
958
|
+
// This is better than a queue with concurrency limit because:
|
|
959
|
+
// 1. If one operation hangs, others can still complete
|
|
960
|
+
// 2. Small files don't get blocked behind large files
|
|
961
|
+
// 3. The Web Locks API already handles per-file serialization
|
|
966
962
|
self.onmessage = (event) => {
|
|
967
963
|
messageQueue.push(event.data);
|
|
968
964
|
if (isReady) {
|