Skip to content

Question: why locking countdowns? #2

@ghost

Description

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:

async with self.countdowns_lock:
self.countdowns.append(countdown)

I have used async back in the tornado days and didn't do much recently. I would only lock if the code was:

 async with self.lock: 
     await ...
     .....
     await ...

(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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions