Skip to content

Instantly share code, notes, and snippets.

@kgriffs
Last active November 7, 2022 16:39
Show Gist options
  • Save kgriffs/6aad0af419d755f809e1c3eea051e565 to your computer and use it in GitHub Desktop.
Save kgriffs/6aad0af419d755f809e1c3eea051e565 to your computer and use it in GitHub Desktop.

Revisions

  1. kgriffs revised this gist Nov 7, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion aiobotocore-config-example.py
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@


    async def example():
    # Equivalent to boto3.client('s3', config=botocore.client.Config(max_pool_connections=20))
    # Equivalent to boto3.client('s3', config=botocore.client.Config(**kwargs))
    # See also for available options:
    # * https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
    # * https://boto3.amazonaws.com/v1/documentation/api/latest/guide/retries.html
  2. kgriffs revised this gist Nov 4, 2022. 1 changed file with 18 additions and 8 deletions.
    26 changes: 18 additions & 8 deletions aiobotocore-config-example.py
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,22 @@
    import asyncio

    import aiobotocore.session
    import aiobotocore.config

    session = aiobotocore.session.get_session()

    # Equivalent to boto3.client('s3', config=botocore.client.Config(max_pool_connections=20))
    # See also for available options:
    # * https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
    # * https://boto3.amazonaws.com/v1/documentation/api/latest/guide/retries.html
    config = aiobotocore.config.AioConfig(max_pool_connections=20)
    async with session.create_client('s3', config=config) as client:
    pass
    async def example():
    # Equivalent to boto3.client('s3', config=botocore.client.Config(max_pool_connections=20))
    # See also for available options:
    # * https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
    # * https://boto3.amazonaws.com/v1/documentation/api/latest/guide/retries.html
    config = aiobotocore.config.AioConfig(
    connect_timeout=5,
    retries=dict(mode='standard'),
    )

    session = aiobotocore.session.get_session()
    async with session.create_client('s3', config=config) as client:
    pass


    asyncio.run(example())
  3. kgriffs revised this gist Nov 1, 2022. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion aiobotocore-config-example.py
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,9 @@
    session = aiobotocore.session.get_session()

    # Equivalent to boto3.client('s3', config=botocore.client.Config(max_pool_connections=20))
    # See also https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html for available options
    # See also for available options:
    # * https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
    # * https://boto3.amazonaws.com/v1/documentation/api/latest/guide/retries.html
    config = aiobotocore.config.AioConfig(max_pool_connections=20)
    async with session.create_client('s3', config=config) as client:
    pass
  4. kgriffs revised this gist Nov 1, 2022. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions aiobotocore-config-example.py
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,7 @@
    session = aiobotocore.session.get_session()

    # Equivalent to boto3.client('s3', config=botocore.client.Config(max_pool_connections=20))
    # See also https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html for available options
    config = aiobotocore.config.AioConfig(max_pool_connections=20)
    async with session.create_client('s3', config=config) as client:
    pass
  5. kgriffs created this gist Nov 1, 2022.
    9 changes: 9 additions & 0 deletions aiobotocore-config-example.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    import aiobotocore.session
    import aiobotocore.config

    session = aiobotocore.session.get_session()

    # Equivalent to boto3.client('s3', config=botocore.client.Config(max_pool_connections=20))
    config = aiobotocore.config.AioConfig(max_pool_connections=20)
    async with session.create_client('s3', config=config) as client:
    pass