Get the singleton client instance in a thread-safe manner
()
| 43 | |
| 44 | |
| 45 | def get_client() -> Client: |
| 46 | """Get the singleton client instance in a thread-safe manner""" |
| 47 | global _client |
| 48 | |
| 49 | # Double-checked locking pattern for thread safety |
| 50 | if _client is None: |
| 51 | with _client_lock: |
| 52 | if _client is None: |
| 53 | _client = Client() |
| 54 | |
| 55 | return _client |
| 56 | |
| 57 | |
| 58 | @deprecated("Automatically tracked in v4.") |
no test coverage detected
searching dependent graphs…