resolve_socket_path
Resolve the first existing socket path from an optional candidate list. The client
constructors use this function when no explicit socket_path is supplied.
Resolve the first existing socket path from the candidate list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
candidates
|
Iterable[Path] | None
|
Optional paths to check in order. When omitted, use Herdr's standard environment and default socket resolution order. |
None
|
session
|
str | None
|
Optional named session used to build the candidate path when
|
None
|
Returns:
| Type | Description |
|---|---|
Path
|
The first existing Unix socket path. |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If none of the candidate paths exists. |
Example
from herdr_client import resolve_socket_path
socket_path = resolve_socket_path(session="work")
print(socket_path)
Source code in src/herdr_client/transport.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | |