You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You're right that this example it looks artificial without any await expressions inside the lock. You're also right that there might be future changes to code here and a surprise await might indeed change behavior of any of the three methods to become incorrect.
I was interested in expressing that "this should be atomic" in the transactional sense. While it's not strictly necessary, it worked in the context of the talks I was giving for which this code was originally written.
Hi Łukasz
I followed your awesome PyCon talk. I did a few similar experiments and I just started to write some music with aiotone.
I have a question about this:
aiotone/aiotone/metronome.py
Lines 32 to 33 in e4e999f
I have used async back in the tornado days and didn't do much recently. I would only lock if the code was:
(Of course we had only yield)
Otherwise there is nothing that can run in between, right? I guess you write it like that in case you change the code to something more complex.
The text was updated successfully, but these errors were encountered: