-
Couldn't load subscription status.
- Fork 5
Make parameters named of new_receiver #155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Introduces a keyword‐only include_events flag on new_receiver, separates data and event channels in GrpcStreamBroadcaster, and updates tests and release notes accordingly.
- Refactors
new_receiverto use overloads and only accept named parameters (maxsize,warn_on_overflow,include_events). - Splits the single broadcast into
_data_channeland an optional_event_channelbased oninclude_events. - Updates tests to parametrize
include_eventsand adjusts assertions; refreshes release notes example.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/streaming/test_grpc_stream_broadcaster.py | Added include_events parameter to tests, updated calls and assertions for events. |
| src/frequenz/client/base/streaming.py | Refactored new_receiver, introduced separate data/event channels, updated run logic. |
| RELEASE_NOTES.md | Clarified new_receiver(include_events=True) usage and example. |
Comments suppressed due to low confidence (3)
src/frequenz/client/base/streaming.py:98
- [nitpick] The doc example uses
asyncio.sleepandasyncio.runbut does not importasyncio. Addimport asyncioat the top of the example.
await asyncio.sleep(0.1)
src/frequenz/client/base/streaming.py:212
- The second overload definition is indented two spaces further than its
@overloaddecorator, causing a syntax/indentation error. Align thedef new_receiverline with its decorator.
def new_receiver(
RELEASE_NOTES.md:15
- The code fence has an extra invalid character (
). It should be just `````python```.
```python
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! But this needs also an entry in Upgrading in the release notes.
RELEASE_NOTES.md
Outdated
|
|
||
| ```python | ||
| recv = streamer.new_receiver() | ||
| ```python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ```python | |
| ```python |
Signed-off-by: Mathias L. Baumann <[email protected]>
new_receivernamed#154 (comment)