Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add async support #159

Closed
wants to merge 5 commits into from
Closed

Conversation

Archmonger
Copy link
Contributor

@Archmonger Archmonger commented Jul 25, 2023

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

  • 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?
    • Maybe the base class can inherit a ReturnType that all methods use? Not sure whether python type hinting is flexible enough to handle this though.
  • Add tests for async functions

Related issues

Type of change

  • New feature (non-breaking change which adds functionality)
  • 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
Copy link
Contributor Author

Closing this since the PR is stale, and I don't know when I'll have time to finish this.

@Archmonger Archmonger closed this Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add async support
1 participant