Introduction
IPC communication channel and event constant definitions. Centrally manages channel names and event names used internally by the framework, avoiding hardcoded strings. Exported as as const objects — values are readonly string literals that can be used as type-safe constants.
Import
// ESM
import { Processes, SocketIO, Events, Receiver } from 'ee-core/const';
// CJS
const { Processes, SocketIO, Events, Receiver } = require('ee-core/const');Also available from the top-level entry:
// ESM
import { Processes, SocketIO, Events, Receiver } from 'ee-core';
// CJS
const { Processes, SocketIO, Events, Receiver } = require('ee-core');API
Processes
Description: Inter-process communication channel constants. Used by the main process and renderer process for Electron IPC messaging. These channel names follow the ee# prefix convention to avoid conflicts with user-defined channels.
| Property | Value | Description |
|---|---|---|
showException | 'ee#showException' | Exception display channel; renderer process displays an exception dialog upon receiving this channel message |
sendToMain | 'ee#sendToMain' | Channel for child process to send messages to the main process |
Example:
import { Processes } from 'ee-core';
// In renderer process — listen for exception display
ipcRenderer.on(Processes.showException, (_event, err) => {
dialog.showErrorBox('Error', err.message);
});
// In child process — send message to main process
childProcess.send({ channel: Processes.sendToMain, data: payload });SocketIO
Description: SocketIO communication channel constants. Used by the Socket.IO server for third-party process communication (Go/Python backends, etc.). The partySoftware value is the default channel name in the framework's Socket.IO configuration.
| Property | Value | Description |
|---|---|---|
partySoftware | 'socket-channel' | Third-party software communication channel (default Socket.IO channel name) |
Example:
import { SocketIO } from 'ee-core';
// SocketIO.partySoftware is used as the default channel in config
const config = getConfig();
console.log(config.socketServer.channel); // 'socket-channel' (SocketIO.partySoftware)Events
Description: Process lifecycle event constants. Used by the framework's exception handling module and child process management to identify specific process exit and error events.
| Property | Value | Description |
|---|---|---|
childProcessExit | 'ee#childProcess#exit' | Child process exit event |
childProcessError | 'ee#childProcess#error' | Child process error event |
Example:
import { Events } from 'ee-core';
// Listening for child process lifecycle events
childProcess.on('exit', (code) => {
console.log(`Event: ${Events.childProcessExit}, code: ${code}`);
});
childProcess.on('error', (err) => {
console.log(`Event: ${Events.childProcessError}`, err);
});Receiver
Description: Message receiver type constants. Used in IPC message routing to identify the intended recipient of a message. Determines how the framework dispatches incoming messages from child processes.
| Property | Value | Description |
|---|---|---|
childJob | 'job' | ChildJob-type child process |
forkProcess | 'task' | Fork process (generic task) |
all | 'all' | All receivers (broadcast) |
Example:
import { Receiver } from 'ee-core';
// When routing a message to a specific receiver type
const message = {
channel: 'controller/user/info',
event: 'request',
data: payload,
receiver: Receiver.childJob, // target: ChildJob process
};
// Broadcast to all receivers
const broadcastMsg = {
...message,
receiver: Receiver.all,
};See also: message, jobs, jobs-childjob
