ModuleManager
Defined in: procwire-bun-core/src/manager.ts:68
ModuleManager - Orchestrates lifecycle of worker modules.
This is the Bun.js version; the API is identical to @procwire/core.
Example
Section titled “Example”const manager = new ModuleManager();
const worker = new Module('worker') .executable('python', ['worker.py']) .method('process') .spawnPolicy({ restartOnCrash: true });
manager.register(worker);
manager.on('module:ready', (name) => console.log(`${name} ready`));manager.on('module:error', (name, err) => console.error(`${name} error:`, err));
await manager.spawn(); // Spawns all modules
// Use modules...const result = await worker.send('process', data);
// Cleanupawait manager.shutdown();Extends
Section titled “Extends”SpawnError<BunSubprocess,Module>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ModuleManager():
ModuleManager
Returns
Section titled “Returns”ModuleManager
Inherited from
Section titled “Inherited from”ModuleManagerCore<BunSubprocess, Module>.constructor