Kernel
The parallel worker interface used to execute jobs.
It allows registering parallel job handlers that are dispatched from a Dispatcher. Jobs can either be:
- Tracked: send and synchronize data back to the dispatcher
- Detached: fire-and-forget dispatch with no synchronization and no data sent back to the dispatcher
Each kernel instance should be bound to exactly one actor.
Functions
new
ParallelCreates a new Kernel bound to an Actor
On
ParallelKernel:On(name: string,--
Job name
process: (id: number,...any) → any) → ()Registers a tracked parallel job
The job will:
- Execute in parallel across actors
- Return results to the dispatcher
- Be synchronized and ordered into the output
This is the standard for computation jobs with no side-effects.
OnDetached
ParallelKernel:OnDetached(name: string,--
Job name
process: (id: number,...any) → any) → ()Registers a detached parallel job
Detached jobs:
- Do not send any data back to the dispatcher
- Do not synchronize or flush
- Do not allocate tables
- Are fire-and-forget
This is the lowest-overhead execution mode and is suitable for pure side-effect jobs such as raycasts, writes, or simulation steps.
Ready
Kernel:Ready() → ()Marks this kernel as ready
This sets the internal ready attribute used by the dispatcher to determine whether the actor is ready to receive jobs.