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

Close subscription streams on remove #67

Merged
merged 3 commits into from
Sep 15, 2022
Merged

Conversation

FZambia
Copy link
Member

@FZambia FZambia commented Sep 9, 2022

This allows exiting from async stream iterators when subscription is removed from Client's registry (i.e. when Client.removeSubscription is called):

final subscription = client.newSubscription(...);

final onPublicationEvent = () async {
  await for (var i in subscription.publication) {
    print('publication: $i');
  }
  print("subscription removed");
};
onPublicationEvent();
client.removeSubscription(subscription)

Adresses #65

@FZambia FZambia temporarily deployed to test_ci September 9, 2022 09:52 Inactive
Copy link

@Amir-P Amir-P left a comment

Choose a reason for hiding this comment

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

LGTM. @FZambia

@FZambia
Copy link
Member Author

FZambia commented Sep 12, 2022

Thx for looking - I'll try to merge it this week then

@FZambia FZambia merged commit a68ece3 into master Sep 15, 2022
@FZambia FZambia deleted the close_streams_on_remove branch September 15, 2022 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants