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

Support for async API calls #246

Open
csparpa opened this issue Apr 13, 2018 · 7 comments
Open

Support for async API calls #246

csparpa opened this issue Apr 13, 2018 · 7 comments

Comments

@csparpa
Copy link
Owner

csparpa commented Apr 13, 2018

This would leverage Python 3.5's async/await features

API calls could just be async functions (aka coroutine functions) that pyowm returns and then get executed on an eventloop provided by client code

note: asyncio is part of the python std library only from 3.5 so 3.4 doesn't feature it (but asyncio can be imported as an external dependency)

Design solution

Make PyOWM 2.x sync functions a "sub-case" of async functions as stated here: https://stackoverflow.com/questions/53521716/enhance-synchronous-software-api-to-allow-asynchronous-consuming/53523001#53523001

@csparpa csparpa added this to the Release 3.0.0 milestone Apr 13, 2018
@csparpa csparpa self-assigned this Apr 13, 2018
@csparpa
Copy link
Owner Author

csparpa commented Nov 26, 2018

Take a look here for sync/async library calls handling: https://hackernoon.com/controlling-python-async-creep-ec0a0f4b79ba

@csparpa csparpa removed this from the Release 3.0.0 milestone Feb 27, 2020
@csparpa csparpa closed this as completed Feb 14, 2022
@Harmon758
Copy link
Contributor

This is something I'd be interested in. Any specific reason it's now wontfix?

@csparpa
Copy link
Owner Author

csparpa commented Feb 14, 2022

@Harmon758 No user interest so far.. and then you shouted ;-) I don't want to rule this feature out if it eventually proves useful !

@y2kbadbug
Copy link

I'll throw my hat into the game, I am interested as my bot I plan on using OWM with is already async.

@aitorllj93
Copy link

@csparpa I personally would appreciate if you mind reopening this

@csparpa csparpa reopened this Feb 19, 2023
@csparpa
Copy link
Owner Author

csparpa commented Feb 19, 2023

@aitorllj93 @y2kbadbug @Harmon758 open again :)

Are you able to collaborate on this?

@y2kbadbug
Copy link

So currently I implemented this on my own vanilla script using Python Treq to make the asynchronous calls. It is written on top of Twisted.

https://pypi.org/project/treq/

This might not be ideal for this project as the level of dependencies it can add, but when I get some free time I'll be happy to poke at a solution for this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants