An extension to the p4python module, adding async functionality to Perforce.
Use your favorite package manager to install the module into your project
pip install p4asyncuv add p4async
from p4async import P4Async
p4a = P4Async()
await p4a.aconnect()All relevant Perforce commands have async counterparts prefixed with a.
For example: aconnect(), arun(), arun_clients(), afetch_change(), etc.
Commands are executed with a lock on a worker thread. The way this is done can be customized via subclassing.
It would appear that current versions of p4python do not release
the pythong GIL (global interpreter lock) while doing a connect() call. This means that even aconnect() is currently blocking. This might get fixed by Perforce at some point.
- Use uv for dependency management and virtual environments.
MIT