diff options
| author | Rapptz <[email protected]> | 2017-05-14 17:59:17 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2017-05-14 17:59:17 -0400 |
| commit | c45d18a6ea761aae71d9b04900b878d0f2fc544d (patch) | |
| tree | dfab9fa361a617ada5424011e019f7c2ca938912 /docs/migrating.rst | |
| parent | Fix FAQ using string for IDs. (diff) | |
| download | discord.py-c45d18a6ea761aae71d9b04900b878d0f2fc544d.tar.xz discord.py-c45d18a6ea761aae71d9b04900b878d0f2fc544d.zip | |
Add note about upgraded dependencies in the migrating page.
Diffstat (limited to 'docs/migrating.rst')
| -rw-r--r-- | docs/migrating.rst | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/docs/migrating.rst b/docs/migrating.rst index ed2ce4be..b4b22d23 100644 --- a/docs/migrating.rst +++ b/docs/migrating.rst @@ -634,6 +634,35 @@ when reached instead of setting the return to ``None``. For example: else: await channel.send('You said {0.content}, {0.author}.'.format(msg)) +Upgraded Dependencies +----------------------- + +Following v1.0 of the library, we've updated our requirements to ``aiohttp`` v2.0 or higher. + +Since this is a backwards incompatible change, it is recommended that you see the +`changes <http://aiohttp.readthedocs.io/en/stable/changes.html#rc1-2017-03-15>`_ and the +`migrating <http://aiohttp.readthedocs.io/en/stable/migration.html>`_ pages for details on the breaking changes in +``aiohttp``. + +Of the most significant for common users is the removal of helper functions such as: + +- ``aiohttp.get`` +- ``aiohttp.post`` +- ``aiohttp.delete`` +- ``aiohttp.patch`` +- ``aiohttp.head`` +- ``aiohttp.put`` +- ``aiohttp.request`` + +It is recommended that you create a session instead: :: + + async with aiohttp.ClientSession() as sess: + async with sess.get('url') as resp: + # work with resp + +Since it is better to not create a session for every request, you should store it in a variable and then call +``session.close`` on it when it needs to be disposed. + Sharding ---------- |