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

Are streams broadcast? #48

Closed
Taha-Firoz opened this issue Nov 9, 2021 · 2 comments
Closed

Are streams broadcast? #48

Taha-Firoz opened this issue Nov 9, 2021 · 2 comments

Comments

@Taha-Firoz
Copy link

I had a similar problem with generated streams from dbus-dart where streams weren't broadcast by default and would throw an error if listened to more than once. Does this problem exist for nm too, I was going through the source and didn't see any conversion to asBroadcastStream. This can be a use case when certain streams should only be listened to when a specific widget is visible which is destroyed after.

@jpnurmi
Copy link
Contributor

jpnurmi commented Nov 9, 2021

All stream controllers are using the StreamController.broadcast constructor:

lib/src/network_manager_client.dart:1935:  final propertiesChangedStreamController =
lib/src/network_manager_client.dart:1936:      StreamController<List<String>>.broadcast();
lib/src/network_manager_client.dart:2181:  final _deviceAddedStreamController =
lib/src/network_manager_client.dart:2182:      StreamController<NetworkManagerDevice>.broadcast();
lib/src/network_manager_client.dart:2183:  final _deviceRemovedStreamController =
lib/src/network_manager_client.dart:2184:      StreamController<NetworkManagerDevice>.broadcast();
lib/src/network_manager_client.dart:2185:  final _activeConnectionAddedStreamController =
lib/src/network_manager_client.dart:2186:      StreamController<NetworkManagerActiveConnection>.broadcast();
lib/src/network_manager_client.dart:2187:  final _activeConnectionRemovedStreamController =
lib/src/network_manager_client.dart:2188:      StreamController<NetworkManagerActiveConnection>.broadcast();

@Taha-Firoz
Copy link
Author

Thank you

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

No branches or pull requests

2 participants