Add API for simple system ordering#5165
Conversation
Nilirad
left a comment
There was a problem hiding this comment.
Some doc nits. I'm not confident enough with macros and system internals to do a full review though.
| /// | ||
| /// [`.link()`]: IntoLinkedSystemSet::link | ||
| pub trait IntoLinkedSystemSet<S, P> { | ||
| /// A helper method to create system sets with automatic |
There was a problem hiding this comment.
| /// A helper method to create system sets with automatic | |
| /// A helper method to create system sets with sequential |
| /// | ||
| /// [`.then()`]: IntoSequentialSystemSet::then | ||
| pub trait IntoSequentialSystemSet<S0, S1, P0, P1> { | ||
| /// A helper method to create system sets with automatic |
There was a problem hiding this comment.
| /// A helper method to create system sets with automatic | |
| /// A helper method to create system sets with sequential |
|
Nice work! I'll do a full review soon. Did you experiment with the .then() syntax as well? |
|
I’m not up-to-date on bevyengine/rfcs#45 but isn't the terminology |
|
Yes, but to do that we'll need to first rename the existing system chaining :) |
|
This seems awfully similar to earlier iterations of #2381 before it was extended to support fan-in/fan-out topologies: strictly sequential, no graph ordering. While the |
|
Hello, sorry for the late response. I was not aware of #2381 and bevyengine/rfcs#45, whoops sorry. In hindsight, this is a very naive way of implementing sequential chains of system. I honestly think that there should be an easier way of making a linear sequential order of systems, but with the rfc I probably think it would be for the best that we should wait until stageless is implemented. However, I think the proc-macro I made for this should be useful in implementing |
|
Closing as this has been done in the stageless rework. |
Objective
Solution
IntoLinkedSystemSetandIntoSequentialSystemSet.SystemSetthat can be added toAppthroughApp::add_system_set.IntoLinkedSystemSetIntoLinkedSystemSetis a trait that provides a methodlink().IntoLinkedSystemSetis implemented on tuples of systems containing 2 to 15 elements.Syntax:
This is equal to:
IntoSequentialSystemSetIntoSequentialSystemSetis trait that provides a methodthen(next_system)IntoSequentialSystemSetis implemented on a system, and accepts a system.Syntax:
This is equal to:
Or
Known Limitations
IntoSequentialSystemSetis not implemented forSystemSet. This means you can't dosystem_a.then(system_b).then(system_c).IntoLinkedSystemSetis not implemented for tuples with more than 15 elements.Changelog
Added
IntoSequentialSystemSet::thenand doingsystem_a.then(system_b).IntoLinkedSystemSet::linkon tuples of systems.