new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Electron · Tutorial · all subjects

ipc & communication

5 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

LanguageModelAppendOptions signal parameter

LanguageModelAppendOptions object has a signal parameter of type AbortSignal, which is a Node.js global class used to signal abort operations.

MessageChannelMain creates connected MessagePortMain pairs

MessageChannelMain is the main-process-side equivalent of the DOM MessageChannel object. Its singular function is to create a pair of connected MessagePortMain objects.

MessageChannelMain instance properties

MessageChannelMain has two instance properties: port1 and port2, both of type MessagePortMain.

MessageChannelMain usage example with port transfer

Example: In the main process, create a MessageChannelMain instance, send port2 to a renderer via webContents.postMessage(), and use port1 to send messages. In the renderer process, receive the port in the ipcRenderer 'port' event handler via e.ports[0], then set onmessage to receive messages.

Electron built-in classes cannot be subclassed

Electron's built-in classes, including MessageChannelMain, cannot be subclassed in user code.

Give your agent this brain