Files
chongming-utils-request/README.md
T
2026-07-21 16:14:59 +08:00

26 lines
566 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# chongming-request
Worker 直连客户端,用于从服务端调用 Zenoh Worker 的 RPC 方法。
## 功能
- 自动发现存活 Worker(基于 Zenoh liveliness)
- 随机负载均衡
- 超时重试
- 支持同步/异步调用
## 使用
```python
from chongming_request import Client
async with Client(session=zenoh_session) as client:
result = await client.call(
worker_type="example",
subject="example.add",
payload={"a": 1, "b": 2},
method="GET"
)
print(result) # {"result": 3, "operation": "add", ...}
```