phoenix-channels-python-client 0.2.0__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {phoenix_channels_python_client-0.2.0/phoenix_channels_python_client.egg-info → phoenix_channels_python_client-0.2.2}/PKG-INFO +3 -3
- {phoenix_channels_python_client-0.2.0 → phoenix_channels_python_client-0.2.2}/README.md +1 -1
- {phoenix_channels_python_client-0.2.0 → phoenix_channels_python_client-0.2.2}/phoenix_channels_python_client/__init__.py +1 -1
- {phoenix_channels_python_client-0.2.0 → phoenix_channels_python_client-0.2.2}/phoenix_channels_python_client/client.py +7 -0
- {phoenix_channels_python_client-0.2.0 → phoenix_channels_python_client-0.2.2}/phoenix_channels_python_client/supervisor.py +7 -1
- {phoenix_channels_python_client-0.2.0 → phoenix_channels_python_client-0.2.2/phoenix_channels_python_client.egg-info}/PKG-INFO +3 -3
- {phoenix_channels_python_client-0.2.0 → phoenix_channels_python_client-0.2.2}/phoenix_channels_python_client.egg-info/requires.txt +1 -1
- {phoenix_channels_python_client-0.2.0 → phoenix_channels_python_client-0.2.2}/pyproject.toml +2 -2
- {phoenix_channels_python_client-0.2.0 → phoenix_channels_python_client-0.2.2}/LICENSE +0 -0
- {phoenix_channels_python_client-0.2.0 → phoenix_channels_python_client-0.2.2}/MANIFEST.in +0 -0
- {phoenix_channels_python_client-0.2.0 → phoenix_channels_python_client-0.2.2}/phoenix_channels_python_client/client_state_machine.py +0 -0
- {phoenix_channels_python_client-0.2.0 → phoenix_channels_python_client-0.2.2}/phoenix_channels_python_client/client_types.py +0 -0
- {phoenix_channels_python_client-0.2.0 → phoenix_channels_python_client-0.2.2}/phoenix_channels_python_client/exceptions.py +0 -0
- {phoenix_channels_python_client-0.2.0 → phoenix_channels_python_client-0.2.2}/phoenix_channels_python_client/phx_messages.py +0 -0
- {phoenix_channels_python_client-0.2.0 → phoenix_channels_python_client-0.2.2}/phoenix_channels_python_client/protocol_handler.py +0 -0
- {phoenix_channels_python_client-0.2.0 → phoenix_channels_python_client-0.2.2}/phoenix_channels_python_client/reconnect_controller.py +0 -0
- {phoenix_channels_python_client-0.2.0 → phoenix_channels_python_client-0.2.2}/phoenix_channels_python_client/topic_runtime.py +0 -0
- {phoenix_channels_python_client-0.2.0 → phoenix_channels_python_client-0.2.2}/phoenix_channels_python_client/topic_subscription.py +0 -0
- {phoenix_channels_python_client-0.2.0 → phoenix_channels_python_client-0.2.2}/phoenix_channels_python_client/utils.py +0 -0
- {phoenix_channels_python_client-0.2.0 → phoenix_channels_python_client-0.2.2}/phoenix_channels_python_client.egg-info/SOURCES.txt +0 -0
- {phoenix_channels_python_client-0.2.0 → phoenix_channels_python_client-0.2.2}/phoenix_channels_python_client.egg-info/dependency_links.txt +0 -0
- {phoenix_channels_python_client-0.2.0 → phoenix_channels_python_client-0.2.2}/phoenix_channels_python_client.egg-info/top_level.txt +0 -0
- {phoenix_channels_python_client-0.2.0 → phoenix_channels_python_client-0.2.2}/setup.cfg +0 -0
- {phoenix_channels_python_client-0.2.0 → phoenix_channels_python_client-0.2.2}/tests/test_internal_components.py +0 -0
- {phoenix_channels_python_client-0.2.0 → phoenix_channels_python_client-0.2.2}/tests/test_reconnect_policy_invariants.py +0 -0
- {phoenix_channels_python_client-0.2.0 → phoenix_channels_python_client-0.2.2}/tests/test_reconnect_stress.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: phoenix-channels-python-client
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: A Python client library for connecting to Phoenix Channels
|
|
5
5
|
Author: Phoenix Channels Python Client
|
|
6
6
|
License-Expression: MIT
|
|
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
14
14
|
Requires-Python: >=3.11
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
16
|
License-File: LICENSE
|
|
17
|
-
Requires-Dist: websockets>=
|
|
17
|
+
Requires-Dist: websockets>=14.2
|
|
18
18
|
Provides-Extra: dev
|
|
19
19
|
Requires-Dist: pytest; extra == "dev"
|
|
20
20
|
Requires-Dist: pytest-asyncio; extra == "dev"
|
|
@@ -72,7 +72,7 @@ pytest
|
|
|
72
72
|
### Dependencies
|
|
73
73
|
|
|
74
74
|
- Python 3.11+
|
|
75
|
-
- `websockets>=
|
|
75
|
+
- `websockets>=14.2`
|
|
76
76
|
|
|
77
77
|
## Quick Start
|
|
78
78
|
|
|
@@ -84,6 +84,7 @@ class PHXChannelsClient(SupervisorMixin, TopicRuntimeMixin, ReconnectControllerM
|
|
|
84
84
|
heartbeat_interval_s: float | None = 30.0,
|
|
85
85
|
on_reconnect: ReconnectCallback | None = None,
|
|
86
86
|
on_disconnect: DisconnectCallback | None = None,
|
|
87
|
+
additional_headers: dict[str, str] | None = None,
|
|
87
88
|
):
|
|
88
89
|
self.logger = logger
|
|
89
90
|
|
|
@@ -116,6 +117,12 @@ class PHXChannelsClient(SupervisorMixin, TopicRuntimeMixin, ReconnectControllerM
|
|
|
116
117
|
self.channel_socket_url = connect_url
|
|
117
118
|
self.channel_socket_url_redacted = redacted_url
|
|
118
119
|
|
|
120
|
+
# Extra WebSocket handshake headers, re-sent on every (re)connect. Lets a
|
|
121
|
+
# caller send the API key as an ``x-api-key`` header instead of (or
|
|
122
|
+
# alongside) the URL query, so a trusted proxy can inject/replace it
|
|
123
|
+
# in-header and the credential stays out of URL/proxy logs.
|
|
124
|
+
self.additional_headers = dict(additional_headers or {})
|
|
125
|
+
|
|
119
126
|
self.auto_reconnect = auto_reconnect
|
|
120
127
|
self.reconnect_policy = reconnect_policy or ReconnectPolicy()
|
|
121
128
|
self.join_timeout_s = join_timeout_s
|
|
@@ -45,6 +45,7 @@ class SupervisorMixin:
|
|
|
45
45
|
logger: logging.Logger
|
|
46
46
|
channel_socket_url: str
|
|
47
47
|
channel_socket_url_redacted: str
|
|
48
|
+
additional_headers: dict[str, str]
|
|
48
49
|
auto_reconnect: bool
|
|
49
50
|
reconnect_policy: ReconnectPolicy
|
|
50
51
|
connection: ClientConnection | None
|
|
@@ -137,7 +138,12 @@ class SupervisorMixin:
|
|
|
137
138
|
self.channel_socket_url,
|
|
138
139
|
)
|
|
139
140
|
try:
|
|
140
|
-
|
|
141
|
+
connect_kwargs = {}
|
|
142
|
+
if additional_headers := getattr(self, "additional_headers", None):
|
|
143
|
+
connect_kwargs["additional_headers"] = additional_headers
|
|
144
|
+
connection = await connect(
|
|
145
|
+
self.channel_socket_url, **connect_kwargs
|
|
146
|
+
)
|
|
141
147
|
except asyncio.CancelledError:
|
|
142
148
|
raise
|
|
143
149
|
except Exception as exc:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: phoenix-channels-python-client
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: A Python client library for connecting to Phoenix Channels
|
|
5
5
|
Author: Phoenix Channels Python Client
|
|
6
6
|
License-Expression: MIT
|
|
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
14
14
|
Requires-Python: >=3.11
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
16
|
License-File: LICENSE
|
|
17
|
-
Requires-Dist: websockets>=
|
|
17
|
+
Requires-Dist: websockets>=14.2
|
|
18
18
|
Provides-Extra: dev
|
|
19
19
|
Requires-Dist: pytest; extra == "dev"
|
|
20
20
|
Requires-Dist: pytest-asyncio; extra == "dev"
|
|
@@ -72,7 +72,7 @@ pytest
|
|
|
72
72
|
### Dependencies
|
|
73
73
|
|
|
74
74
|
- Python 3.11+
|
|
75
|
-
- `websockets>=
|
|
75
|
+
- `websockets>=14.2`
|
|
76
76
|
|
|
77
77
|
## Quick Start
|
|
78
78
|
|
{phoenix_channels_python_client-0.2.0 → phoenix_channels_python_client-0.2.2}/pyproject.toml
RENAMED
|
@@ -4,14 +4,14 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "phoenix-channels-python-client"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.2"
|
|
8
8
|
description = "A Python client library for connecting to Phoenix Channels"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
11
11
|
authors = [{ name = "Phoenix Channels Python Client" }]
|
|
12
12
|
requires-python = ">=3.11"
|
|
13
13
|
dependencies = [
|
|
14
|
-
"websockets>=
|
|
14
|
+
"websockets>=14.2",
|
|
15
15
|
]
|
|
16
16
|
classifiers = [
|
|
17
17
|
"Development Status :: 3 - Alpha",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|