mirror of
https://github.com/ente-io/ente.git
synced 2025-08-08 07:28:26 +00:00
Scaffold
This commit is contained in:
parent
1a9170632e
commit
1e720b4b7d
10
desktop/src/main/services/ml-util-test.ts
Normal file
10
desktop/src/main/services/ml-util-test.ts
Normal file
@ -0,0 +1,10 @@
|
||||
console.log("in utility process");
|
||||
|
||||
process.parentPort.once("message", (e) => {
|
||||
console.log("got message in utility process", e);
|
||||
const [port] = e.ports;
|
||||
|
||||
port?.on("message", (e2) => {
|
||||
console.log("got message on port in utility process", e2);
|
||||
});
|
||||
});
|
@ -62,7 +62,7 @@ import { utilityProcess } from "electron/main";
|
||||
export const createMLSession = () => {
|
||||
const { port1, port2 } = new MessageChannelMain();
|
||||
|
||||
const child = utilityProcess.fork("./ml-utility");
|
||||
const child = utilityProcess.fork("./ml-util-test");
|
||||
child.postMessage(/* unused */ "", [port1]);
|
||||
|
||||
ipcRenderer.postMessage("ml-session-port", /* unused */ "", [port2]);
|
||||
|
@ -334,6 +334,17 @@ export interface Electron {
|
||||
|
||||
// - ML
|
||||
|
||||
/**
|
||||
* Create a new ML session.
|
||||
*
|
||||
* This creates a new Node.js utility process, and sets things up so that we
|
||||
* can communicate directly with that utility process using a
|
||||
* {@link MessagePort} we get back.
|
||||
*
|
||||
* For more details about the IPC flow, see: [Note: ML IPC].
|
||||
*/
|
||||
createMLSession: () => Promise<MessagePort>;
|
||||
|
||||
/**
|
||||
* Return a CLIP embedding of the given image.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user