procwire-bun-core/src
@procwire/bun-core - Core module system for Procwire binary protocol (Bun.js optimized).
This package provides the Module class for defining and communicating with worker processes using the binary data plane, optimized for Bun.js runtime.
Example
Section titled “Example”import { Module } from '@procwire/bun-core';import { msgpackCodec } from '@procwire/codecs';import { arrowCodec } from '@procwire/codecs/arrow'; // opt-in; requires `apache-arrow`
// Define a moduleconst worker = new Module('worker') .executable('python', ['worker.py']) .method('process', { codec: msgpackCodec }) .method('batch', { codec: arrowCodec, response: 'stream' }) .event('progress');
// After manager.spawn():const result = await worker.send('process', data);
for await (const chunk of worker.stream('batch', items)) { console.log(chunk);}
worker.onEvent('progress', (p) => console.log(`${p}%`));Classes
Section titled “Classes”References
Section titled “References”AddEvent
Section titled “AddEvent”Renames and re-exports SpawnError
AddMethod
Section titled “AddMethod”Renames and re-exports SpawnError
AddMethodSymmetric
Section titled “AddMethodSymmetric”Renames and re-exports SpawnError
BunDrainWaiter
Section titled “BunDrainWaiter”Renames and re-exports SpawnError
ChildEventType
Section titled “ChildEventType”Renames and re-exports SpawnError
ChildRequestType
Section titled “ChildRequestType”Renames and re-exports SpawnError
ChildResponseType
Section titled “ChildResponseType”Renames and re-exports SpawnError
DualCodecMethodConfig
Section titled “DualCodecMethodConfig”Renames and re-exports SpawnError
EmptySchema
Section titled “EmptySchema”Renames and re-exports SpawnError
EventConfig
Section titled “EventConfig”Renames and re-exports SpawnError
EventDescriptor
Section titled “EventDescriptor”Renames and re-exports SpawnError
ExecutableConfig
Section titled “ExecutableConfig”Renames and re-exports SpawnError
ExtractSchema
Section titled “ExtractSchema”Renames and re-exports SpawnError
InferCodecInput
Section titled “InferCodecInput”Renames and re-exports SpawnError
InferCodecOutput
Section titled “InferCodecOutput”Renames and re-exports SpawnError
InitMessage
Section titled “InitMessage”Renames and re-exports SpawnError
ManagerErrors
Section titled “ManagerErrors”Renames and re-exports SpawnError
ManagerEvent
Section titled “ManagerEvent”Renames and re-exports SpawnError
ManagerEvents
Section titled “ManagerEvents”Renames and re-exports SpawnError
MethodConfig
Section titled “MethodConfig”Renames and re-exports SpawnError
MethodDescriptor
Section titled “MethodDescriptor”Renames and re-exports SpawnError
MethodsWithoutResponseType
Section titled “MethodsWithoutResponseType”Renames and re-exports SpawnError
MethodsWithResponseType
Section titled “MethodsWithResponseType”Renames and re-exports SpawnError
ModuleErrors
Section titled “ModuleErrors”Renames and re-exports SpawnError
ModuleEvent
Section titled “ModuleEvent”Renames and re-exports SpawnError
ModuleEvents
Section titled “ModuleEvents”Renames and re-exports SpawnError
ModuleSchema
Section titled “ModuleSchema”Renames and re-exports SpawnError
ModuleState
Section titled “ModuleState”Renames and re-exports SpawnError
ParentEventType
Section titled “ParentEventType”Renames and re-exports SpawnError
ParentRequestType
Section titled “ParentRequestType”Renames and re-exports SpawnError
ParentResponseType
Section titled “ParentResponseType”Renames and re-exports SpawnError
ProcwireError
Section titled “ProcwireError”Renames and re-exports SpawnError
ResponseType
Section titled “ResponseType”Renames and re-exports SpawnError
RestartLimitConfig
Section titled “RestartLimitConfig”Renames and re-exports SpawnError
RetryDelayConfig
Section titled “RetryDelayConfig”Renames and re-exports SpawnError
Schema
Section titled “Schema”Renames and re-exports SpawnError
SendReturn
Section titled “SendReturn”Renames and re-exports SpawnError
SingleCodecMethodConfig
Section titled “SingleCodecMethodConfig”Renames and re-exports SpawnError
SpawnError
Section titled “SpawnError”Re-exports SpawnError
SpawnPolicy
Section titled “SpawnPolicy”Renames and re-exports SpawnError
TypedEventConfig
Section titled “TypedEventConfig”Renames and re-exports SpawnError