pyarr icon indicating copy to clipboard operation
pyarr copied to clipboard

Add async support

Open Archmonger opened this issue 2 years ago • 0 comments

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.cast and inspect.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 tests locally and passed
  • [ ] I have tested this feature in a python script

Archmonger avatar Jul 25 '23 08:07 Archmonger