Skip to main content

Automatic aiohttp ClientSession management

Project description

A module to automatically manage aiohttp.ClientSession objects for you to improve performance.

The package manages a global cache of aiohttp.ClientSession objects based on the host a particular request is connecting to so connections can be reused between requests.

It also simplifies the API.

Usage

The usage is similar to the python requests library:

import aiohttp_client
async with aiohttp_client.get('http://www.google.com') as resp:
    # do something here

Configuration

Uses env variables to configure max number of reqeusts/sessions to manage:

  • AIOHTTP_SESSION_SIZE: max number of sessions to keep in cache(default 200)

  • AIOHTTP_SESSION_DNS_CACHE: number of seconds to keep dns lookup in cache(default 20)

  • AIOHTTP_SESSION_LIMIT: number of simultaneous connections to have per session(default 500)

1.1.1 (2020-04-15)

  • better session connector defaults

1.1.0 (2019-06-06)

  • update max requests and sessions

  • Updated setup.py to point to aihttp_client.py

1.0.0 (2018-04-09)

  • initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiohttp_client_manager-1.1.1.tar.gz (2.6 kB view details)

Uploaded Source

File details

Details for the file aiohttp_client_manager-1.1.1.tar.gz.

File metadata

  • Download URL: aiohttp_client_manager-1.1.1.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.6

File hashes

Hashes for aiohttp_client_manager-1.1.1.tar.gz
Algorithm Hash digest
SHA256 8e0ee0a839f3cce3291cf41282f71c0b6f0c5d425863ca22eb20eb9a0170ce21
MD5 29c8f9a96db8330d252eb86d5bbcb7aa
BLAKE2b-256 0fa936f64c06af5d885bd0785a7c88df8b438c187032eb4dc49279ab03ab1b3f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page