Skip to content

Commit 8cb7ea4

Browse files
committed
Update dispatch api client
To support to use the official TLS domains, once setup Signed-off-by: Mathias L. Baumann <mathias.baumann@frequenz.com>
1 parent 9454379 commit 8cb7ea4

File tree

5 files changed

+11
-19
lines changed

5 files changed

+11
-19
lines changed

RELEASE_NOTES.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
11
# Dispatch Highlevel Interface Release Notes
22

3-
## Summary
4-
5-
<!-- Here goes a general summary of what this release is about -->
6-
73
## Upgrading
84

9-
<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->
10-
11-
## New Features
12-
13-
<!-- Here goes the main new features and examples or instructions on how to use them -->
5+
This is a breaking release that requires you to use the new URL for the dispatch service.
146

157
## Bug Fixes
168

17-
* Fixes reconnecting after connection loss for streams
18-
* Fixed an issue in the `Dispatcher` class where the client connection was not properly disconnected during cleanup, potentially causing unclosed socket errors.
9+
* Fix that a user might see invalid values for dispatches without `end_time`.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ dependencies = [
4040
# plugins.mkdocstrings.handlers.python.import)
4141
"frequenz-sdk >= 1.0.0-rc1302, < 1.0.0-rc1900",
4242
"frequenz-channels >= 1.6.1, < 2.0.0",
43-
"frequenz-client-dispatch >= 0.9.0, < 0.10.0",
43+
"frequenz-client-dispatch >= 0.10.0, < 0.11.0",
4444
]
4545
dynamic = ["version"]
4646

src/frequenz/dispatch/_bg_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import grpc.aio
1818
from frequenz.channels import Broadcast, Receiver, select, selected_from
1919
from frequenz.channels.timer import SkipMissedAndResync, Timer
20-
from frequenz.client.dispatch import Client
20+
from frequenz.client.dispatch import DispatchApiClient
2121
from frequenz.client.dispatch.types import Event
2222
from frequenz.sdk.actor import BackgroundService
2323

@@ -90,7 +90,7 @@ def __init__(
9090
def __init__(
9191
self,
9292
microgrid_id: int,
93-
client: Client,
93+
client: DispatchApiClient,
9494
) -> None:
9595
"""Initialize the background service.
9696

src/frequenz/dispatch/_dispatcher.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from typing import Awaitable, Callable, Self
1313

1414
from frequenz.channels import Receiver
15-
from frequenz.client.dispatch import Client
15+
from frequenz.client.dispatch import DispatchApiClient
1616
from frequenz.sdk.actor import Actor, BackgroundService
1717
from typing_extensions import override
1818

@@ -151,7 +151,8 @@ async def run():
151151
```
152152
153153
Example: Creating a new dispatch and then modifying it.
154-
Note that this uses the lower-level `Client` class to create and update the dispatch.
154+
Note that this uses the lower-level `DispatchApiClient` class to create
155+
and update the dispatch.
155156
156157
```python
157158
import os
@@ -213,7 +214,7 @@ def __init__(
213214
"""
214215
super().__init__()
215216

216-
self._client = Client(server_url=server_url, key=key)
217+
self._client = DispatchApiClient(server_url=server_url, key=key)
217218
self._bg_service = DispatchScheduler(
218219
microgrid_id,
219220
self._client,
@@ -349,7 +350,7 @@ async def stop_managing(self, dispatch_type: str) -> None:
349350
self._empty_event.set()
350351

351352
@property
352-
def client(self) -> Client:
353+
def client(self) -> DispatchApiClient:
353354
"""Return the client."""
354355
return self._client
355356

tests/test_managing_actor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def __init__(self, *, server_url: str, key: str):
333333
mid = 1
334334

335335
# Patch `Client` class in Dispatcher with MyFakeClient
336-
with patch("frequenz.dispatch._dispatcher.Client", MyFakeClient):
336+
with patch("frequenz.dispatch._dispatcher.DispatchApiClient", MyFakeClient):
337337
dispatcher = Dispatcher(
338338
microgrid_id=mid, server_url="grpc://test-url", key="test-key"
339339
)

0 commit comments

Comments
 (0)