Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/connectrpc/_client_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,21 @@ def __init__(
) -> None:
"""Creates a new asynchronous Connect client.

When providing an HTTP client, for example to configure TLS settings,
it is the caller's responsibility to close it.

Examples:
```python
from pyqwest import Client
from my_service import MyServiceClient

async with (
Client() as http_client,
MyServiceClient("http://localhost:8000", http_client=http_client) as client,
):
# Use the client!
```

Args:
address: The address of the server to connect to, including scheme.
codec: The [Codec][] to use for requests. If unset, defaults to binary protobuf.
Expand Down Expand Up @@ -175,7 +190,7 @@ def __init__(
self._execute_bidi_stream = execute_bidi_stream

async def close(self) -> None:
"""Close the HTTP client. After closing, the client cannot be used to make requests."""
"""Close the client. After closing, the client cannot be used to make requests."""
if not self._closed:
self._closed = True

Expand Down
17 changes: 16 additions & 1 deletion src/connectrpc/_client_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,21 @@ def __init__(
) -> None:
"""Creates a new synchronous Connect client.

When providing an HTTP client, for example to configure TLS settings,
it is the caller's responsibility to close it.

Examples:
```python
from pyqwest import SyncClient
from my_service import MyServiceClientSync

with (
SyncClient() as http_client,
MyServiceClientSync("http://localhost:8000", http_client=http_client) as client,
):
# Use the client!
```

Args:
address: The address of the server to connect to, including scheme.
codec: The [Codec][] to use for requests. If unset, defaults to binary protobuf.
Expand Down Expand Up @@ -174,7 +189,7 @@ def __init__(
self._execute_bidi_stream = execute_bidi_stream

def close(self) -> None:
"""Close the HTTP client. After closing, the client cannot be used to make requests."""
"""Close the client. After closing, the client cannot be used to make requests."""
if not self._closed:
self._closed = True

Expand Down
3 changes: 2 additions & 1 deletion zensical.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ alternate_style = true
[project.plugins.mkdocstrings.handlers.python]
inventories = [
"https://docs.python.org/3/objects.inv",
"https://protobufpy.com/objects.inv"
"https://protobufpy.com/objects.inv",
"https://pyqwest.dev/objects.inv",
]
paths = ["src"]

Expand Down
Loading