-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 asyncio #458
Comments
Thanks for logging this! Currently I'm only calling In case it helps, aiodns provides an example of supporting asyncio on Python 2.6+ (see https://github.com/saghul/aiodns#python-versions). If boto3 was already written with the assumption of blocking rather than asynchronous I/O throughout, I'm not sure how disruptive a change this would be. |
I'm not that familiar with the internals of botocore, but I think the right approach is to create a custom version of endpoint.py and client.py that used aiohttp under the hood and yielded as you want. I would probably start by subclassing Endpoint and making an aiohttp version of _send_request and _get_request. I'd also subclass ClientCreator and override _create_api_method (that is where the calls to the endpoint come from). I haven't yet figured out how i'd get from a service object to a client created with my ClientCreator subclass. Does that sound right, @jamesls? I might have a go... |
I've started a port of botocore to asyncio, at: https://github.com/rdbhost/botocore So far, the S3 integration tests pass, as do about 2/3 of the unit tests. I hope to have all tests converted and passing by a week from now. The port depends on yieldfrom.requests and yieldfrom.urllib3 , asyncio ports of the requests and urllib3 libraries. |
+1 |
1 similar comment
+1 |
This issue has gotten a couple of +1s in the last few days, so I thought I https://github.com/rdbhost/yieldfromBotocore It implements an asyncio version of botocore, not boto3. I may eventually David On Thu, Jun 18, 2015 at 6:59 AM, AlexNigl [email protected] wrote:
|
+1 |
@rdbhost, thanks for tackling that! It seems, however, that https://github.com/rdbhost/yieldfromBotocore is 271 commits behind upstream. Are you actively maintaining it? |
My intention has been to do a merge when upstream reached v1.0; that seems to have happened without my noticing. I will be merging commits from upstream, this weekend. |
+1 @jamesls are you planning on pulling rdbhost's changes into botocore itself? We are very interested in this feature. |
It is not a very promising candidate for merging back into botocore. The changes are numerous, and the changes needed to make botocore functional within asyncio make it non-functional outside asyncio. I expect it to be a seperate product indefinitely, with a parallel API, meaning an API as similar as possible within the asyncio constraints. |
One thing that also complicates things is that botocore supports as far back as python 2.6.5, so we'll need to figure out how we can support asyncio and still maintain py2 support. I see that there are asyncio backports to python2, so perhaps something could be done there. |
Trollius ( |
+1 |
I have working port of botocore for asyncio: https://github.com/jettify/aiobotocore using aiohttp for async http requests. I am trying to reuse as much botocore code as possible, so I patched only several classes and just import rest of the code as result library has few hundreds lines of code. And this approach helps to keep up with upstream, but obvious downside, I rely on internal interfaces which is subject of change for new libs. API almost the same as botocore just For now I am using aiobotocore with s3 and ported almost all s3 test, except I need to work more on pagination since it is not easy to implement iterator protocol with |
+1 integrating aiobotocore might be doable |
+1 |
3 similar comments
+1 |
+1 |
+1 |
OK guys, I've written a production ready, and hopefully useful to the community, asyncio extension to botocore. The library is currently included in https://github.com/quantmind/pulsar-cloud in the asyncbotocore module but it is self-contained and could be striped out if needed. The API is the same as botocore but with the addition of
If used with pulsar, the library can also use greenlet in an implicit asynchronous fashion. Check https://github.com/quantmind/pulsar-cloud for more info By the way, thanks to @jettify for the initial effort from which I leveraged from Feedbacks welcome! |
@lsbardel yes, |
@asvetlov cool, I understand the private attribute thing, but the I would be happy to use https://github.com/jettify/aiobotocore has low level async botocore library but currently it does not work with pulsar http client. At the moment it clearly requires So maybe we should converge to a library that allows for different |
By the way all that is python 3.4 or above |
@lsbardel At asyncio active development times Guido was against public loop attribute, he motivated it as "user always may pass explicit loop if needed". I don't think the decision has changed now. |
+1 |
1 similar comment
+1 |
+1 |
let's make python javascript AGAIN! |
Any updates about this issue? |
Hi all, thanks for your patience. I brought up this up for discussion with the team and the consensus was that async support won't be considered until the next major version. Implementing this would require an entire rewrite of botocore, and that effort is currently being allocated to creating a longer term async solution for botocore users. |
Could you please clarify what you mean by that? Wouldn’t “creating a longer term async solution for botocore users” be basically the same thing as a rewrite of botocore? |
@tim-finnigan is it means you started rewriting the botocore? Can you collaborate with aiobotocore instead? |
Redis corporate took over the entire Python redis ecosystem. If a community botocore was written supporting both sync and async(io), would AWS consider adopting it? |
@tim-finnigan do you have any update? |
@stalkerg this ticket was opened 8 years ago, there's a ticket (aws-cloudformation/cloudformation-coverage-roadmap#196 (comment)) created 4 years ago to add support for stupid tags (something that should maybe take an hour). I wouldn't hold my breath. There's aioboto3 and aiobotocore which basically wraps boto3 and botocore in async functions. |
We’re interested in first class support because aiobotocore is (partially by necessity) a bad citizen of the Python package ecosystem.
So unless aiobotocore becomes unnecessary because botocore gains async support, we’re stuck with a (as said multiple times necessary) hack. |
Relevant aio-libs/aiobotocore#1017 (comment) Funny, he removed it. Basically said that they're not expecting this to happen before 2024, and it will likely be a major version. |
not anymore they rewrote a lot of parts and did async/await drill down. But yes, they still have a dependence on the botocore. |
+1 |
@tim-finnigan sorry for ping you again, but do you have any updates? Any roadmaps or just strategy? It's literally difficult to do business with AWS predictable right now. |
Who's looking forward to celebrating the 10th birthday of this issue with me in Feb? I think it's safe to say that this isn't going to happen, given that AWS is happy to exploit both the open source community's goodwill and their willingness to compensate for boto's shortcomings. See you all in another decade. |
To keep the conversation alive, check awslabs/aws-crt-python#558 I'm glad the community was even able to come up with the aioboto libraries (shout out to its maintainers 🥇 ), boto is a beast of its own. Maybe Amazon is aiming to standardize everything on CRT? |
i simply can't believe this... |
This is a tracking issue for the feature request of supporting asyncio in botocore, originally asked about here: #452
There's no definitive timeline on this feature, but feel free to +1 (thumbs up 👍) this issue if this is something you'd like to see. Also, if you have any additional information about asyncio you'd like to share (even just about your specific use case) feel free to chime in.
The text was updated successfully, but these errors were encountered: