AsyncHerdrClient
Asynchronous client for the herdr Unix socket API.
The constructor page is the shortlink hub for the complete asynchronous client reference. Await every operation and use the subscription pages for streaming events.
Constructor
Create an asynchronous client for a Herdr Unix socket.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
socket_path
|
str | Path | None
|
Explicit socket path. When omitted, use Herdr's standard socket resolution order. |
None
|
timeout
|
float
|
Timeout in seconds for connect, write and read operations. |
5.0
|
session
|
str | None
|
Named Herdr session to resolve instead of |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If both |
Example
from herdr_client import AsyncHerdrClient
client = AsyncHerdrClient(session="work", timeout=5.0)
print(client.socket_path)
Source code in src/herdr_client/async_client/client.py
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | |
Method shortlinks
| Method | Purpose |
|---|---|
request |
Send a raw or canonical protocol request |
ping |
Check that the server is reachable |
workspace_list |
List workspaces |
tab_list |
List tabs, optionally by workspace |
pane_list |
List panes, optionally by workspace |
pane_send_text |
Send literal text to a pane |
pane_send_keys |
Send named keys to a pane |
pane_send_input |
Send text and keys in one operation |
pane_read |
Read pane output |
pane_wait_for_output |
Wait for matching output |
subscribe |
Open a server-event subscription |