Skip to content

Commit 5a1d130

Browse files
adamtheturtleclaude
andcommitted
Add close() to Transport protocol for resource cleanup parity
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e2b7d1c commit 5a1d130

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/vws/transports.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ class Transport(Protocol):
1818
returns a ``Response``.
1919
"""
2020

21+
def close(self) -> None:
22+
"""Close the transport and release resources."""
23+
... # pylint: disable=unnecessary-ellipsis
24+
2125
def __call__(
2226
self,
2327
*,
@@ -51,6 +55,13 @@ class RequestsTransport:
5155
This is the default transport.
5256
"""
5357

58+
def close(self) -> None:
59+
"""Close the transport.
60+
61+
This is a no-op for ``RequestsTransport`` as it does not
62+
hold persistent connections.
63+
"""
64+
5465
def __call__(
5566
self,
5667
*,

0 commit comments

Comments
 (0)