Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我有一个A依赖于的目标,B但我可以并行运行。用 Shake 可以吗?当然,这似乎使动作顺序化,这完全有道理,但这是一个“特殊”情况。ABneed ...
A
B
need ...
鉴于:
"A" %> \_ -> do need ["B"]; ... "B" %> \_ -> ...
如果你这样做了,need ["A","B"]那么它将并行启动A,B但A操作将立即暂停,直到B完成。为什么并行运行是安全A的?B如果由计算的操作在更改A时需要重新运行B,但实际上并没有使用B自己,您可以重新排序为:
need ["A","B"]
"A" %> \_ -> do ...; need ["B"]
但是,如果A实际使用中的操作,B则没有真正的方法可以并行运行它们。