Asyncio compatibility

What is the compatibility of Panda’s run loop with asyncio’s Lock, Semaphore, and BoundedSemaphore classes? The asyncio classes implement await, which makes them soo much more friendly than the threading classes of the same name. These asyncio classes work as expected in a test Showbase program. However, that doesn’t mean that they are compatible.

In principle, anything from asyncio that’s awaitable should be awaitable within a Panda coroutine as well, but it’s possible that those constructs rely on particular implementation details from asyncio. Let me know if you do run into compatibility issues.

However, please note that asyncio isn’t thread-safe, so you can’t use asyncio.Lock across multiple threads (this includes threaded task chains).

It would not be particularly difficult for us to provide a thread-safe async Lock class with Panda, if this is desirable.