Skip to content

Introduction

ChildJob is implemented based on Node.js child processes. A process is created only when a task is triggered. After the task completes, you must call the process exit method: Ps.exit(), otherwise the process will not exit and will waste resources.

Advantage: Create on demand, release after use, does not excessively consume computer resources.

Limitation: When creating tasks frequently and in large quantities, there is overhead from starting processes, causing slight delays. For such business scenarios, ChildPoolJob is recommended.

Note: Node.js child processes cannot use any Electron APIs (Electron technology itself does not support this). Related business logic should be written in the main process

Directory

./electron/jobs

Usage

See: Example code in the demo branch