ElijahKSmith / Bot

A Discord bot that makes use of the League of Legends API
Mozilla Public License 2.0
0 stars 0 forks source link

Refactor HTTP requests to be asynchronous #1

Open ElijahKSmith opened 4 years ago

ElijahKSmith commented 4 years ago

Been reading a bunch about HTTP requests in Python and learned that the current use of the Requests library is blocking. While there are no current plans to host the bot in such a way that it would be used on multiple servers to actually see the effects of these blocking calls it's still bad practice. Therefore the requests will be refactored in one of the following ways or another if I find an easier way to do so:

EDIT: See https://hackernoon.com/how-to-run-asynchronous-web-requests-in-parallel-with-python-3-5-without-aiohttp-264dc0f8546

ElijahKSmith commented 4 years ago

Either grequests or AIOHTTP uses a monkey-patched version of ssl.py so grequests is out.