Skip to content

Add ability to set timeout in Session objects #232

@syeopite

Description

@syeopite
  • Explain the use-case carefully. Maybe with a code example
    It makes sense to be able to set a universal timeout that all requests made with the session can adhere to. This avoids having to pass a custom timeout for every single request
async with AsyncSession(timeout=50) as s:
    # Has a timeout of 50 seconds
    resp = await s.get('/v1/users')
  • Who needs this?
  • What pain does this resolve?
    This prevents having to pass the timeout parameter on every single request
  • Is this standard?
    Yes. Both httpx and aiohttp for example allows setting a timeout on their respective client objects

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions