Skip to content
Open
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: 4 additions & 2 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@

## Upgrading

<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->
- The old `Broadcast` class is deprecated in favour of the new auto-closing `BroadcastChannel`.

- The `Anycast` class is deprecated, because of the lack of use-cases and the maintenance cost.

## New Features

<!-- Here goes the main new features and examples or instructions on how to use them -->
- There's a new `BroadcastChannel`, which returns a broadcast sender and a broadcast receiver. The channel is auto-closing, meaning when all the senders or all the receivers are closed, the channel is closed.

## Bug Fixes

Expand Down
17 changes: 15 additions & 2 deletions src/frequenz/channels/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"""

from ._anycast import Anycast
from ._broadcast import Broadcast
from ._broadcast import Broadcast, BroadcastChannel, BroadcastReceiver, BroadcastSender
from ._exceptions import ChannelClosedError, ChannelError, Error
from ._generic import (
ChannelMessageT,
Expand All @@ -101,14 +101,26 @@
select,
selected_from,
)
from ._sender import Sender, SenderClosedError, SenderError
from ._sender import (
CloneableSender,
CloneableSubscribableSender,
Sender,
SenderClosedError,
SenderError,
SubscribableSender,
)

__all__ = [
"Anycast",
"Broadcast",
"BroadcastChannel",
"BroadcastReceiver",
"BroadcastSender",
"ChannelClosedError",
"ChannelError",
"ChannelMessageT",
"CloneableSender",
"CloneableSubscribableSender",
"Error",
"ErroredChannelT_co",
"LatestValueCache",
Expand All @@ -128,6 +140,7 @@
"SenderError",
"SenderMessageT_co",
"SenderMessageT_contra",
"SubscribableSender",
"UnhandledSelectedError",
"merge",
"select",
Expand Down
6 changes: 6 additions & 0 deletions src/frequenz/channels/_anycast.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
_logger = logging.getLogger(__name__)


@deprecated(
"Anycast channels are deprecated, because of the high cost of maintaining "
"something for which we don't have a use case. The implementation will "
"remain in the codebase in its current form at least until the next major "
"version."
)
class Anycast(Generic[ChannelMessageT]):
"""A channel that delivers each message to exactly one receiver.

Expand Down
Loading
Loading