Skip to content

@web-engine-dev/scheduler


@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 ​

typescript
// 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 ​

readonly fn: SystemFn<TContext>

The system function to execute


id ​

readonly id: SystemId

Unique identifier for the system


labels? ​

readonly optional labels: string[]

Labels for system sets


parallelizable? ​

readonly optional parallelizable: boolean

Whether this system can run in parallel with others


runAfter? ​

readonly optional runAfter: SystemId[]

Systems that must run before this one


runBefore? ​

readonly optional runBefore: SystemId[]

Systems that must run after this one


runConditions? ​

readonly optional runConditions: RunCondition<TContext>[]

Run conditions that must all return true for system to execute


stage? ​

readonly optional stage: string

Stage this system belongs to

Proprietary software. All rights reserved.