groove-x / trio-util

Utility library for the Python Trio async/await framework
https://trio-util.readthedocs.io/
MIT License
68 stars 6 forks source link

document assurances of AsyncValue.wait_value(), etc. #14

Open belm0 opened 3 years ago

belm0 commented 3 years ago

wait_value(), wait_transition() and transitions() all ensure they block on changes to the current value without an intervening context switch. I.e. the last inspected value will still be in place when the blocking is activated.

Code often needs to rely on this to prevent race conditions and achieve eventual consistency.