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
14 changes: 4 additions & 10 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
# Dispatch Highlevel Interface Release Notes

## Summary

<!-- Here goes a general summary of what this release is about -->

## Upgrading

<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->

## New Features
This is a breaking release that requires you to use the new URL for the dispatch service:

<!-- Here goes the main new features and examples or instructions on how to use them -->
* Staging: `grpc://dispatch.eu-1.staging.api.frequenz.com:443`
* Production: `grpc://dispatch.eu-1.prod.api.frequenz.com:443`

## Bug Fixes

* Fixes reconnecting after connection loss for streams
* Fixed an issue in the `Dispatcher` class where the client connection was not properly disconnected during cleanup, potentially causing unclosed socket errors.
* Fix that a user might see invalid values for dispatches without `end_time`.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dependencies = [
# plugins.mkdocstrings.handlers.python.import)
"frequenz-sdk >= 1.0.0-rc1302, < 1.0.0-rc1900",
"frequenz-channels >= 1.6.1, < 2.0.0",
"frequenz-client-dispatch >= 0.9.0, < 0.10.0",
"frequenz-client-dispatch >= 0.10.0, < 0.11.0",
]
dynamic = ["version"]

Expand Down
4 changes: 2 additions & 2 deletions src/frequenz/dispatch/_bg_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import grpc.aio
from frequenz.channels import Broadcast, Receiver, select, selected_from
from frequenz.channels.timer import SkipMissedAndResync, Timer
from frequenz.client.dispatch import Client
from frequenz.client.dispatch import DispatchApiClient
from frequenz.client.dispatch.types import Event
from frequenz.sdk.actor import BackgroundService

Expand Down Expand Up @@ -90,7 +90,7 @@ def __init__(
def __init__(
self,
microgrid_id: int,
client: Client,
client: DispatchApiClient,
) -> None:
"""Initialize the background service.

Expand Down
9 changes: 5 additions & 4 deletions src/frequenz/dispatch/_dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from typing import Awaitable, Callable, Self

from frequenz.channels import Receiver
from frequenz.client.dispatch import Client
from frequenz.client.dispatch import DispatchApiClient
from frequenz.sdk.actor import Actor, BackgroundService
from typing_extensions import override

Expand Down Expand Up @@ -151,7 +151,8 @@ async def run():
```

Example: Creating a new dispatch and then modifying it.
Note that this uses the lower-level `Client` class to create and update the dispatch.
Note that this uses the lower-level `DispatchApiClient` class to create
and update the dispatch.

```python
import os
Expand Down Expand Up @@ -213,7 +214,7 @@ def __init__(
"""
super().__init__()

self._client = Client(server_url=server_url, key=key)
self._client = DispatchApiClient(server_url=server_url, key=key)
self._bg_service = DispatchScheduler(
microgrid_id,
self._client,
Expand Down Expand Up @@ -349,7 +350,7 @@ async def stop_managing(self, dispatch_type: str) -> None:
self._empty_event.set()

@property
def client(self) -> Client:
def client(self) -> DispatchApiClient:
"""Return the client."""
return self._client

Expand Down
2 changes: 1 addition & 1 deletion tests/test_managing_actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def __init__(self, *, server_url: str, key: str):
mid = 1

# Patch `Client` class in Dispatcher with MyFakeClient
with patch("frequenz.dispatch._dispatcher.Client", MyFakeClient):
with patch("frequenz.dispatch._dispatcher.DispatchApiClient", MyFakeClient):
dispatcher = Dispatcher(
microgrid_id=mid, server_url="grpc://test-url", key="test-key"
)
Expand Down
Loading