Skip to content

Use a single instance for improve performance. #2559

Answered by zanieb
byehack asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @byehack — yes that is recommended but you'll want to context manage the client

async def main:
    async with httpx.AsyncClient() as client:
        ....

See https://www.python-httpx.org/async/#making-async-requests

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by zanieb
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants