Skip to content
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

Add stop method for MergeNamed and Merge channels #68

Conversation

ela-kotulska-frequenz
Copy link
Contributor

Both channels stores async tasks that listen on the receivers. If they are removed without stopping the receivers tasks, then user gets error: Task was destroyed but it is pending!

stop method should be called when channel is no longer needed. Destructor can't be async, so we do that with extra method stop.

Signed-off-by: ela-kotulska-frequenz elzbieta.kotulska@frequenz.com

@ela-kotulska-frequenz ela-kotulska-frequenz added the part:synchronization Affects the synchronization of multiple sources (`select`, `merge`) label Jan 26, 2023
@ela-kotulska-frequenz ela-kotulska-frequenz added this to the v0.13.0 milestone Jan 26, 2023
@ela-kotulska-frequenz ela-kotulska-frequenz requested a review from a team as a code owner January 26, 2023 13:33
@ela-kotulska-frequenz ela-kotulska-frequenz self-assigned this Jan 26, 2023
@github-actions github-actions bot added part:core Affects the core types (`Sender`, `Receiver`, exceptions, etc.) and removed part:synchronization Affects the synchronization of multiple sources (`select`, `merge`) labels Jan 26, 2023
Copy link
Contributor

@mathias-baumann-frequenz mathias-baumann-frequenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be mentioned in the release notes?

src/frequenz/channels/util/_merge.py Outdated Show resolved Hide resolved
src/frequenz/channels/util/_merge_named.py Outdated Show resolved Hide resolved
src/frequenz/channels/util/_merge_named.py Outdated Show resolved Hide resolved
@ela-kotulska-frequenz ela-kotulska-frequenz force-pushed the stop_channel branch 2 times, most recently from f58acc4 to 31d9a77 Compare January 26, 2023 15:52
@github-actions github-actions bot added the part:docs Affects the documentation label Jan 26, 2023
Both channels stores async tasks that listen on the receivers.
If they are removed without stopping the receivers tasks,
then user gets error: Task was destroyed but it is pending!

`stop` method should be called when channel is no longer needed.
Destructor can't be async, so we do that with extra method `stop`.

Signed-off-by: ela-kotulska-frequenz <elzbieta.kotulska@frequenz.com>
@sahas-subramanian-frequenz sahas-subramanian-frequenz changed the title Add stop method for MergeNamed and Merge channels. Add stop method for MergeNamed and Merge channels Jan 26, 2023
@ela-kotulska-frequenz ela-kotulska-frequenz merged commit d6d717b into frequenz-floss:v0.x.x Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
part:core Affects the core types (`Sender`, `Receiver`, exceptions, etc.) part:docs Affects the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants