pyarr
pyarr copied to clipboard
Add async support
Description
After a bit of thinking, I've determined a way to implement async support in the most minimal way possible.
By creating an AsyncRequestHandler and having variants of the *arrs (ex. AsyncSonarrAPI) use this subclass, this allows for the existing code to return async.
As a result, sonarr/radarr/readarr/etc models will not need to be modified to maintain async support.
Task List
- [x] Create async request handler
- [ ] Create async *arrs that use this new request handler
- [ ] Develop some way of automatically rewriting the type hints for async *arrs endpoints to indicate that they are awaitable. Maybe using a mixture of
typing.castandinspect.getfullargspec? - [ ] Add tests for async functions
Related issues
- fix #149
Type of change
- [x] New feature (non-breaking change which adds functionality)
- [x] CI / Tests update
How has this been tested
- [ ] I have added new tests where required
- [ ] I have run
nox -s testslocally and passed - [ ] I have tested this feature in a python script