Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it easier to reuse connections #967

Open
andreer opened this issue Nov 5, 2024 · 0 comments
Open

Make it easier to reuse connections #967

andreer opened this issue Nov 5, 2024 · 0 comments
Assignees
Milestone

Comments

@andreer
Copy link
Member

andreer commented Nov 5, 2024

Currently in our fasthtml demo app, each call to Vespa uses the pattern

    async def get_something_from_vespa(self, doc_id: str) -> str:
        async with self.app.asyncio(connections=1) as session:
            ...

This ends up opening a new connection, doing TLS handshake for every request.

Quoting the doc, the session "should be used as a session manager" but this means we can't really store and reuse it.

Perhaps we can pass a httpx client which can be (re)used for the session?

@oyving oyving added this to the soon milestone Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants