@componentor/fs 2.0.9 → 2.0.10
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/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.cjs
CHANGED
|
@@ -950,23 +950,19 @@ async function handleMessage(msg) {
|
|
|
950
950
|
}
|
|
951
951
|
}
|
|
952
952
|
|
|
953
|
-
// Process queued messages
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
let activeOperations = 0;
|
|
957
|
-
|
|
958
|
-
async function processQueue() {
|
|
959
|
-
while (messageQueue.length > 0 && activeOperations < MAX_CONCURRENT) {
|
|
953
|
+
// Process queued messages after ready
|
|
954
|
+
function processQueue() {
|
|
955
|
+
while (messageQueue.length > 0) {
|
|
960
956
|
const msg = messageQueue.shift();
|
|
961
|
-
|
|
962
|
-
handleMessage(msg).finally(() => {
|
|
963
|
-
activeOperations--;
|
|
964
|
-
processQueue(); // Process next queued message
|
|
965
|
-
});
|
|
957
|
+
handleMessage(msg); // Process concurrently - don't wait
|
|
966
958
|
}
|
|
967
959
|
}
|
|
968
960
|
|
|
969
|
-
//
|
|
961
|
+
// Handle messages concurrently - each operation proceeds independently
|
|
962
|
+
// This is better than a queue with concurrency limit because:
|
|
963
|
+
// 1. If one operation hangs, others can still complete
|
|
964
|
+
// 2. Small files don't get blocked behind large files
|
|
965
|
+
// 3. The Web Locks API already handles per-file serialization
|
|
970
966
|
self.onmessage = (event) => {
|
|
971
967
|
messageQueue.push(event.data);
|
|
972
968
|
if (isReady) {
|