Skip to content

Expose scheduler builder to ECS World#327

Merged
waynemwashuma merged 5 commits into
wimaengine:devfrom
waynemwashuma:expose-scheduler-builder
May 29, 2026
Merged

Expose scheduler builder to ECS World#327
waynemwashuma merged 5 commits into
wimaengine:devfrom
waynemwashuma:expose-scheduler-builder

Conversation

@waynemwashuma
Copy link
Copy Markdown
Collaborator

@waynemwashuma waynemwashuma commented May 27, 2026

Objective

Expose the SchedulerBuilder as an application resource to support:

  • schedule inspection/debug tooling
  • future runtime schedule manipulation
  • external schedule analysis systems

Additionally, refactor the scheduling internals to better separate global builder orchestration from per-schedule compilation logic.

Solution

Previously, the SchedulerBuilder existed as a privately inside App. This made the scheduling pipeline inaccessible to external systems such as inspector, editor tooling, debugging utilities and runtime schedule mutation systems

Changes made

Exposed SchedulerBuilder as a resource

The builder is now registered through CorePlugin. This allows systems and tooling to access the active scheduling state through the ECS world/resource system. The App now delegates scheduling operations through SchedulerBuilder.Instance instead of maintaining a private instance field.

Refactored schedule compilation into ScheduleContext

As part of exposing the builder globally, the internal scheduling logic was refactored to better isolate per-schedule state.

Introduced ScheduleContext which now owns:

  • system registration
  • group registration
  • parent resolution
  • cycle detection
  • graph expansion
  • topology sorting
  • ordering resolution

SchedulerBuilder now primarily acts as:

  • a registration collector
  • a context factory
  • a scheduler orchestration layer

Why this approach

Exposing the scheduler builder as a resource enables future tooling and runtime features without requiring direct access to the App internals.

Examples include:

  • visual schedule inspectors
  • hot-reloading systems
  • runtime system injection/removal
  • debugging schedule graphs
  • editor integrations

The ScheduleContext refactor supports this by ensuring schedule-local state is isolated and easier to reason about independently.

Showcase

N/A

Migration guide

No migration required

Checklist

  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@waynemwashuma waynemwashuma self-assigned this May 27, 2026
@waynemwashuma waynemwashuma added the type:enhancement New feature or request label May 27, 2026
@github-actions github-actions Bot added mod:app mod:schedule This PR/issue affects the schedule module labels May 27, 2026
@waynemwashuma waynemwashuma marked this pull request as ready for review May 29, 2026 04:42
@waynemwashuma waynemwashuma merged commit 6784092 into wimaengine:dev May 29, 2026
8 checks passed
@waynemwashuma waynemwashuma deleted the expose-scheduler-builder branch May 29, 2026 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:app mod:schedule This PR/issue affects the schedule module type:enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant