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

aiohttp #15

Open
vanous opened this issue Jan 20, 2018 · 4 comments
Open

aiohttp #15

vanous opened this issue Jan 20, 2018 · 4 comments
Labels

Comments

@vanous
Copy link

vanous commented Jan 20, 2018

Hy all,

:)

thanks for the nice library, have been using it for a discord bot for blitz. Have you considered moving to aiohttp for 3.6 async stuff? I will perhaps try it internally, but am not sure about full legacy python and python support...

cheers
Petr

@vanous
Copy link
Author

vanous commented Jan 23, 2018

Hi,
so i have tried, but have failed, due to the complexity of how the library tries to autodetect stuff etc through iterators... It probably is not so complicated, but i have no experience with async code. If i can help in any way, let me know...

thank you
P.

@monester
Copy link
Collaborator

Hi @vanous

Thanks for your question, but unfortunately this library will not implement async functionality in nearest future.
I don't have much experience with async/await, so I can't do it same best as it is right now.

@vanous
Copy link
Author

vanous commented Jan 24, 2018

Hi Alex,

thank you for getting back to me. Same almost zero experience with async on my side. I have used aiohttp previously (the replacement for requests) so i will probably slowly convert from your (really nice) library to direct aiohtp json calls. My issue and reason for it is, that as the usage of my bot goes higher, it is happening more and more frequently that people use some of the more complex commands, which pull data from several WG endpoint and the blocking causes the discord.py to restart.

Thank you for for all the work!

cheers

Petr

@vanous
Copy link
Author

vanous commented Jan 29, 2018

Hi Alex,

Just for you or anyone else interested. I have ended up wrapping the WG calls into asyncio loop.run_in_executor, which should span a new thread and allows to return control to the main thread at least partially so the blocking stops breaking the persistent websockets connection the main event loop needs to maintain.

Cheers P.

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

No branches or pull requests

2 participants