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.
orElse当由于另一个事务写入TVar它已读取的事务而重试事务时,是否调用“else”部分,或者仅在retry显式调用时调用?
orElse
TVar
retry
如果你有
或其他ab
then只有在被显式调用时b才会运行。否则本质上将变得不确定。(由 STM 运行时完成的事务重新运行是透明的,不应影响任何计算的结果。)retryaorElse
b
a