Make `create_client()` return a singleton client
Open
high priority
- Dominant language
- Python
- Stars
- 415
- Forks
- 50
- PR merge metrics
- No merged PRs in 30d
Description
We've discussed this multiple times, time to do it.
`create_client()` and `create_async_client()` should create a client once upon the first call (one sync singleton and one async singleton respectively) and follow on calls should just return that first thing.
* Add `detached=False` argument to force creating a new client when flipped to `True`
* Obviously singletons should be partitioned by connection arguments
* Use `weakref.WeakValueDictionaty[ConnectionSpec, Client]`
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.