@web-engine-dev/scheduler / SystemDescriptor
Interface: SystemDescriptor<TContext>
System descriptor with metadata.
Describes a system's identity, execution function, dependencies, and behavior. Can be created directly or via the defineSystem builder.
Example
// Direct descriptor creation
const physicsSystem: SystemDescriptor<GameContext> = {
id: 'physics',
fn: (ctx) => updatePhysics(ctx.world, ctx.deltaTime),
stage: CoreStages.UPDATE,
runAfter: ['input'],
runBefore: ['render'],
parallelizable: true,
runConditions: [(ctx) => !ctx.isPaused],
};
scheduler.addSystem(physicsSystem);Type Parameters
TContext
TContext = unknown
Properties
fn
readonlyfn:SystemFn<TContext>
The system function to execute
id
readonlyid:SystemId
Unique identifier for the system
labels?
readonlyoptionallabels:string[]
Labels for system sets
parallelizable?
readonlyoptionalparallelizable:boolean
Whether this system can run in parallel with others
runAfter?
readonlyoptionalrunAfter:SystemId[]
Systems that must run before this one
runBefore?
readonlyoptionalrunBefore:SystemId[]
Systems that must run after this one
runConditions?
readonlyoptionalrunConditions:RunCondition<TContext>[]
Run conditions that must all return true for system to execute
stage?
readonlyoptionalstage:string
Stage this system belongs to