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
8 changes: 7 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@
If calling this function manually and passing `ChannelOptions`, it is recommended
to switch to passing `ChannelOptions` via keyword argument.

* All parameters of the Streamers `new_receiver` method are now keyword-only arguments. This means that you must specify them by name when calling the method, e.g.:

```python
recv = streamer.new_receiver(max_size=50, warn_on_overflow=True)
```

## New Features

* The streaming client, when using `new_receiver(include_events=True)`, will now return a receiver that yields stream notification events, such as `StreamStarted`, `StreamRetrying`, and `StreamFatalError`. This allows you to monitor the state of the stream:

```python
```python
recv = streamer.new_receiver(include_events=True)

for msg in recv:
Expand Down
6 changes: 3 additions & 3 deletions src/frequenz/client/base/streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,26 +194,26 @@ def __init__( # pylint: disable=too-many-arguments,too-many-positional-argument
@overload
def new_receiver(
self,
*,
maxsize: int = 50,
warn_on_overflow: bool = True,
*,
include_events: Literal[False] = False,
) -> channels.Receiver[OutputT]: ...

@overload
def new_receiver(
self,
*,
maxsize: int = 50,
warn_on_overflow: bool = True,
*,
include_events: Literal[True],
) -> channels.Receiver[StreamEvent | OutputT]: ...

def new_receiver(
self,
*,
maxsize: int = 50,
warn_on_overflow: bool = True,
*,
include_events: bool = False,
) -> channels.Receiver[OutputT] | channels.Receiver[StreamEvent | OutputT]:
"""Create a new receiver for the stream.
Expand Down
Loading