Skip to content

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

javascript
// 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:

javascript
// 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.

PropertyValueDescription
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:

javascript
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 });

See also: socket, message


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.

PropertyValueDescription
partySoftware'socket-channel'Third-party software communication channel (default Socket.IO channel name)

Example:

javascript
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)

See also: socket, cross


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.

PropertyValueDescription
childProcessExit'ee#childProcess#exit'Child process exit event
childProcessError'ee#childProcess#error'Child process error event

Example:

javascript
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);
});

See also: exception, jobs


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.

PropertyValueDescription
childJob'job'ChildJob-type child process
forkProcess'task'Fork process (generic task)
all'all'All receivers (broadcast)

Example:

javascript
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