Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What's the usage of require_before/require_after? #195

Open
snskshn opened this issue Apr 16, 2024 · 1 comment
Open

What's the usage of require_before/require_after? #195

snskshn opened this issue Apr 16, 2024 · 1 comment

Comments

@snskshn
Copy link

snskshn commented Apr 16, 2024

As I understood, things like as follows:

// case1. without require_before
A
B.after_all(A) // A -> B
C.after_all(B) // A -> B -> C

// case2. with require_before
A
B.require_after(A).after_all(A) // A -> B
C.require_after(B).after_all(B) // A -> B -> C

Then, require_after is useless?? what's the case of require*'s usage?

@leudz
Copy link
Owner

leudz commented Jun 12, 2024

after_all/before_all change systems ordering but don't check if the system is present in the workload.
require_after/require_before don't change systems ordering but assert that a system is present in the workload.


So let's say you have this instead:

A
C.after_all(B)

There is no B so C is placed automatically, after_all(B) is ignored.

With this:

A
C.require_before(B).after_all(B)

You get an error saying that C expected a system B but there was none in the workload.

System(C) is missing some systems before: [System(B)]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants