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 #149

Open
2 tasks done
Archmonger opened this issue Apr 24, 2023 · 1 comment
Open
2 tasks done

Add async support #149

Archmonger opened this issue Apr 24, 2023 · 1 comment
Labels
P3 Low-priority issue that needs to be resolved type/feature New feature or request

Comments

@Archmonger
Copy link
Contributor

Archmonger commented Apr 24, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Expected feature

Async support.

Possible Solutions

Use aiohttp to add async support.

In order to keep our code simple, we should write all existing methods as async methods. Then, based on some kind of initialization parameter (ex SonarrAPI(async=True) we should run an abstract transformation on existing methods.

To oversimplify how the abstract transformation would work, async=True would replace the async functions with sync wrappers that use asyncio.run. This transformation would occur during __init__.

To minimize rewriting, we should implement a system similar to how aiohttp-requests creates and deletes the async session.

Context / Reason

Library does not have async support.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Archmonger Archmonger added type/feature New feature or request P3 Low-priority issue that needs to be resolved labels Apr 24, 2023
@Archmonger
Copy link
Contributor Author

@marksie1988

I created this issue to explain a maintainable way we could create async support in the future.

@Archmonger Archmonger mentioned this issue Jul 25, 2023
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 Low-priority issue that needs to be resolved type/feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant