temporalio / sdk-python

Temporal Python SDK
MIT License
457 stars 68 forks source link

Add tests of asyncio.Lock and asyncio.Semaphore usage #567

Open dandavison opened 3 months ago

dandavison commented 3 months ago

Fixes #554

Add tests confirming that asyncio.Lock and asyncio.Semaphore can be used in workflow code to control concurrency of coroutines (tasks spawned by the main coroutine, and update handlers).

The fact that these tests pass largely follows from the fact that our event loop implementation has functioning implementations of call_later() call_soon(), so these tests could alternatively be moved into the features repo, as part of a feature test confirming that all languages have mutex/semaphore primitives that can be used for this sort of workflow concurrency control.