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
6 changes: 0 additions & 6 deletions trpc_sdk/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

- :mod:`~trpc_sdk.client._options` — ``Options`` container and per-request construction
- :mod:`~trpc_sdk.client._client` — unary invoke path: message, node select, timeout
- :mod:`~trpc_sdk.client._stream` — client-side stream implementations
- :mod:`~trpc_sdk.client._stream_factory` — stream factories; each call needs a fresh stream
- :mod:`~trpc_sdk.client._config` — deprecated shim over :class:`trpc_sdk.config.TrpcConfig`
"""

Expand All @@ -28,14 +26,10 @@
from ._client import select_node
from ._client import set_timeout
from ._client import update_message
from ._stream import Stream
from ._stream_factory import create_stream

__all__ = [
"Client",
"Options",
"Stream",
"create_stream",
"get_client",
"get_options",
"normalize_options",
Expand Down
6 changes: 6 additions & 0 deletions trpc_sdk/stream/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
The package is split by responsibility:

- :mod:`~trpc_sdk.stream._client` — :class:`ClientStream` and the client factory
- :mod:`~trpc_sdk.stream._stream` — transport connection used by :class:`ClientStream`
- :mod:`~trpc_sdk.stream._stream_factory` — one fresh :class:`Stream` per call
- :mod:`~trpc_sdk.stream._server` — :class:`ServerStream` and :class:`StreamDispatcher`
- :mod:`~trpc_sdk.stream._flow_control` — send / receive window
- :mod:`~trpc_sdk.stream._constants`, :mod:`~trpc_sdk.stream._options`,
Expand All @@ -36,6 +38,8 @@
from ._server import StreamDispatcher
from ._server import create_server_stream
from ._server import create_stream_dispatcher
from ._stream import Stream
from ._stream_factory import create_stream
from ._types import ClientStreamDesc

__all__ = [
Expand All @@ -52,6 +56,8 @@
"ClientStream",
"ClientStreamDesc",
"Client",
"Stream",
"create_stream",
"create_stream_client",
"default_stream_client",
# Server
Expand Down
2 changes: 1 addition & 1 deletion trpc_sdk/stream/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from trpc_sdk.abc import clone_context_and_message
from trpc_sdk.abc import create_frame_head
from trpc_sdk.client import Options
from trpc_sdk.client import create_stream
from trpc_sdk.client import get_options
from trpc_sdk.client import update_message
from trpc_sdk.common import get_or_create_event_loop
Expand All @@ -45,6 +44,7 @@
from ._flow_control import ReceiveControl
from ._flow_control import SendControl
from ._options import get_window_size
from ._stream_factory import create_stream
from ._types import ClientStreamDesc


Expand Down
8 changes: 4 additions & 4 deletions trpc_sdk/client/_stream.py → trpc_sdk/stream/_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

``Stream`` is the public ``trpc_sdk.stream`` protocol transport.

Build instances through :func:`trpc_sdk.client.create_stream`. ``opts`` stays
Build instances through :func:`trpc_sdk.stream.create_stream`. ``opts`` stays
``None`` until :meth:`Stream.start` injects the per-call transport,
codec and deadline.
"""
Expand All @@ -19,12 +19,12 @@

from trpc_sdk.abc import BaseClientStreamConnection
from trpc_sdk.abc import TrpcContext
from trpc_sdk.client import Options
from trpc_sdk.client import select_node
from trpc_sdk.client import set_timeout
from trpc_sdk.compressor import compress
from trpc_sdk.serialization import serialize
from trpc_sdk.utils import now_ms
from ._client import select_node
from ._client import set_timeout
from ._options import Options


class Stream(BaseClientStreamConnection):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"""Client stream factories.

Each outbound stream call needs a fresh object: :attr:`Stream.opts` stays
``None`` until :meth:`~trpc_sdk.client.Stream.start` fills in the per-call
``None`` until :meth:`~trpc_sdk.stream.Stream.start` fills in the per-call
transport, codec and deadline. A shared instance would leak one call's
options into the next.
"""
Expand Down
Loading