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
pycurl support python asyncio or async(await)? #448
Comments
I doubt I will do this but patches are welcome. |
I know this is old. This is the issue that pops up when I google 'pycurl asyncio', so that is why I am asking here. Would pycurl work alright with just putting everything in async def, if the pycurl event loop was hooked up with asyncio? A few years ago, before asyncio was even implemented I think, I was messing with a project 'pyuv', and used Tornado's (at the time) example of a http client, to hook up pycurls event loop, with pyuv. You can see here:
I'm thinking about trying to hook it up with an asyncio event loop (mainly self._multi.setopt(pycurl.M_SOCKETFUNCTION, self._sock_state_cb), if I am remembering correctly).. Should this just work? I'm still pretty newb to using the native python 3 async stuff. If someone knows right off the bat that I would have issues for some reason, it would save me some time... I want to use pycurl as opposed to requests for this particular project I'm working on, because it uses non-http requests. |
If you get it working, please share your findings. |
Take a look at aiocurl: handle = aiocurl.Curl()
handle.setopt(aiocurl.URL, 'https://example.com')
await handle.perform() You can install it with It uses libcurl's socket interface to make asyncio's event loop drive the transfers. |
@fsbs That's cool, if you'd like to add a link to pycurl readme/documentation to your project please send a PR. |
pycurl support python asyncio or async(await)?
The text was updated successfully, but these errors were encountered: