shipyard icon indicating copy to clipboard operation
shipyard copied to clipboard

What's the usage of require_before/require_after?

Open snskshn opened this issue 1 year ago • 1 comments

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?

snskshn avatar Apr 16 '24 14:04 snskshn

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)]

leudz avatar Jun 12 '24 08:06 leudz