Skip to content

SchedulableSystem

Defined in: src/scheduler.ts:7

Contract for a system that can be scheduled with dependency ordering.

TCtx

optional dispose?: (ctx) => void

Defined in: src/scheduler.ts:32

Optional teardown called by the scheduler after the system is removed.

TCtx

void


optional init?: (ctx) => void

Defined in: src/scheduler.ts:34

Optional one-time setup called by the scheduler before the system’s first run.

TCtx

void


readonly name: string

Defined in: src/scheduler.ts:8


readonly optional phase?: string

Defined in: src/scheduler.ts:17

Optional phase name. When the scheduler has been constructed with a non-empty phase list, every system MUST declare a phase from that list and runAfter/runBefore references must stay within the same phase. Phase names are declared per-scheduler by the app — the core ships no defaults. A turn-based game might pick ['input','logic','render']; a real-time one might pick ['input','physics','post-physics','render'].


readonly optional reads?: readonly ComponentRef[]

Defined in: src/scheduler.ts:24

Components this system reads from. Informational in DEV mode: the scheduler warns if a reader’s last writer in the sorted order is not transitively reachable via runAfter/runBefore. No runtime effect in production. Foundation for future parallel execution.


run: (ctx) => void

Defined in: src/scheduler.ts:35

TCtx

void


readonly optional runAfter?: readonly string[]

Defined in: src/scheduler.ts:26

Names of systems that must run before this one.


readonly optional runBefore?: readonly string[]

Defined in: src/scheduler.ts:28

Names of systems that must run after this one.


readonly optional runIf?: (ctx) => boolean

Defined in: src/scheduler.ts:42

Optional run condition, evaluated with the live ctx immediately before each run — a system earlier in the same pass can change the verdict. When it returns false the system is skipped for that pass. It does not gate init, and it does not affect ordering or the DEV access check.

TCtx

boolean


readonly optional writes?: readonly ComponentRef[]

Defined in: src/scheduler.ts:30

Components this system writes to. See reads for semantics.