Get or create a thread-local stash client.
()
| 437 | |
| 438 | |
| 439 | def _get_client(): |
| 440 | class="st">""class="st">"Get or create a thread-local stash client."class="st">"" |
| 441 | client = getattr(_thread_local, &class="cm">#x27;stash_client', None) |
| 442 | if client is None: |
| 443 | socket_path = get_stash_socket_path() |
| 444 | client = StashClient(socket_path) |
| 445 | _thread_local.stash_client = client |
| 446 | return client |
| 447 | |
| 448 | |
| 449 | class="cm"># Module-level functions that use the thread-local client |