@lvce-editor/embeds-worker 2.1.0 → 2.3.0
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/embedsWorkerMain.js +13 -6
- package/package.json +1 -1
package/dist/embedsWorkerMain.js
CHANGED
|
@@ -756,6 +756,9 @@ const createRpc = ipc => {
|
|
|
756
756
|
},
|
|
757
757
|
invokeAndTransfer(method, ...params) {
|
|
758
758
|
return invokeAndTransfer$1(ipc, method, ...params);
|
|
759
|
+
},
|
|
760
|
+
async dispose() {
|
|
761
|
+
await ipc?.dispose();
|
|
759
762
|
}
|
|
760
763
|
};
|
|
761
764
|
return rpc;
|
|
@@ -876,7 +879,7 @@ const create$1 = async ({
|
|
|
876
879
|
port2
|
|
877
880
|
} = getPortTuple();
|
|
878
881
|
// TODO call sendMessagePortToSharedProcess function instead
|
|
879
|
-
await invokeAndTransfer('IpcParent.create',
|
|
882
|
+
await invokeAndTransfer('IpcParent.create', {
|
|
880
883
|
method: 8,
|
|
881
884
|
type: 1,
|
|
882
885
|
initialCommand,
|
|
@@ -914,11 +917,15 @@ const create = async options => {
|
|
|
914
917
|
};
|
|
915
918
|
|
|
916
919
|
const launchEmbedsProcessIpc = async () => {
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
920
|
+
try {
|
|
921
|
+
const ipc = await create({
|
|
922
|
+
initialCommand: 'HandleMessagePortForEmbedsProcess.handleMessagePortForEmbedsProcess'
|
|
923
|
+
});
|
|
924
|
+
handleIpc(ipc);
|
|
925
|
+
return ipc;
|
|
926
|
+
} catch (error) {
|
|
927
|
+
throw new VError(error, `Failed to launch embeds process`);
|
|
928
|
+
}
|
|
922
929
|
};
|
|
923
930
|
|
|
924
931
|
const state = {
|