issue_comments: 693010291

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions issue performed_via_github_app
https://github.com/simonw/datasette/issues/943#issuecomment-693010291 https://api.github.com/repos/simonw/datasette/issues/943 693010291 MDEyOklzc3VlQ29tbWVudDY5MzAxMDI5MQ== 9599 2020-09-15T22:20:55Z 2020-09-15T22:20:55Z OWNER

Should I instantiate a single Client and reuse it for all internal requests, or can I instantiate a new Client for each request?

https://www.python-httpx.org/advanced/#why-use-a-client says that the main benefit of a Client instance is HTTP connection pooling - which isn't an issue for these internal requests since they won't be using the HTTP protocol at all, they'll be calling the ASGI application directly.

So I'm leaning towards instantiating a fresh client for every internal request. I'll run a microbenchmark to check that this doesn't have any unpleasant performance implications.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
681375466  
Powered by Datasette · Query took 1.495ms · About: github-to-sqlite