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

Make a StreamRouter's route remove itself when all listener cancel #673

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

matehat
Copy link

@matehat matehat commented Dec 21, 2020

In a dart library I maintain, where we use StreamRouter, some weird bug was exhibited where a channel being previously listened for, then cancelled, then re-listened wouldn’t get messages on the second listening.

That was because, basically, if you don't reuse the initial stream you got the first time you called StreamRouter().route(...), subsequent equivalent routing would never receive events from the stream router. That's expected, unless you cancel all listeners from the initial stream.

With this PR, once all listeners to the stream have cancelled, the corresponding route is closed and removed from the stream router. This also has the benefit that a stream router now automatically scales down with the amount of stream listened to.

@google-cla
Copy link

google-cla bot commented Dec 21, 2020

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

3 similar comments
@google-cla
Copy link

google-cla bot commented Dec 21, 2020

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no DO NOT CHECK IN. CLA status is not okay. label Dec 21, 2020
@matehat
Copy link
Author

matehat commented Dec 21, 2020

@googlebot I signed it!

@google-cla
Copy link

google-cla bot commented Dec 21, 2020

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

1 similar comment
@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added cla: yes @googlebot is happy with the CLA status of this PR and removed cla: no DO NOT CHECK IN. CLA status is not okay. labels Dec 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes @googlebot is happy with the CLA status of this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants