You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A mechanism to specify whether a system or group of systems should run at all would be nice. You can kind of do this with an early return, but you may have to access data you otherwise don't care about to do this, which isn't great. Also maybe better optimization potential if they exist external to systems.
Describe the solution you'd like to see
For the API, a run condition is a function that returns a boolean - true if the system(s) should run, false if they should not. It will be supplied as the third argument for World.p.addSystems (Schedule addSystem unknown).
The function can either be a system, or a function that accepts the world instance. If the getSystemParameters property exists on the function, it will be treated as a system and its arguments will be parsed. If not, it will be supplied the world.
Example usage:
typeRunCondition=(...args: any[])=>boolean;classWorld{addSystems(scheduleType: ScheduleType,systems: System|System[],condition: RunCondition): this
}// In useconstworld=awaitnewWorld().addSystems(Schedule,mySystem,world=>world.getResource(SomeResource).someProperty).prepare()
Open Questions
When should this be evaluated?
a. Every runSchedule() call
b. When prepare() is called
c. A third API, included in prepare() but called separately?
The text was updated successfully, but these errors were encountered:
Describe the problem this feature solves
A mechanism to specify whether a system or group of systems should run at all would be nice. You can kind of do this with an early return, but you may have to access data you otherwise don't care about to do this, which isn't great. Also maybe better optimization potential if they exist external to systems.
Describe the solution you'd like to see
For the API, a run condition is a function that returns a boolean - true if the system(s) should run, false if they should not. It will be supplied as the third argument for
World.p.addSystems
(Schedule addSystem unknown).The function can either be a system, or a function that accepts the
world
instance. If thegetSystemParameters
property exists on the function, it will be treated as a system and its arguments will be parsed. If not, it will be supplied theworld
.Example usage:
Open Questions
a. Every
runSchedule()
callb. When
prepare()
is calledc. A third API, included in prepare() but called separately?
The text was updated successfully, but these errors were encountered: