I think it needs to take also a client-configuration or a client initializer. Any advice from your use case?
I think it needs to take also a client-configuration or a client initializer. Any advice from your use case?
The async with block is a nice idea but doesn't deal with the reality that often a resource has multiple consumers. For instance, there might be several components of an application that use a database connection -- I really want to make the connection once and tear it down only after all of the clients of that connection have themselves been torn down.
What I'm imagining the answer to be is something a little bit like the Spring Framework but fundamentally centered around asyncio.
- Loading configuration from `main()` e.g. a configuration in via sys.argv and processed by argparse. - Setting configuration within tests. Unless explicitly told otherwise, I'd expect all tests to be performed against an empty cache. Not to mention, there's no guarantee that I'll have access to a server use during tests.