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

API to clear and add Stream subscribers #1168

Closed
philippjfr opened this issue Mar 2, 2017 · 3 comments
Closed

API to clear and add Stream subscribers #1168

philippjfr opened this issue Mar 2, 2017 · 3 comments

Comments

@philippjfr
Copy link
Member

Currently Streams can have subscribers and hidden subscribers. In working on some projects I have found utility in reusing an existing stream but clearing the subscribers manually and manually adding new subscribers since the _hidden_subscribers are not public API this is quite ugly. It would be nice if Streams offered methods to add new subscribers (.listen or .subscribe?) and clear existing subscribers (.clear?).

@jlstevens
Copy link
Contributor

It would be reasonable to have an 'advanced user' API for such things that is public but not something most people would need to worry about most of the time. Definitely better than fiddling with underscore attributes!

From what I remember, _hidden_subscribers partially exists because there needs to be a callback to the plotting class instance. This means calling clear could break the normal stream examples if it removes all subscribers, including everything in _hidden_subscribers. This isn't to say clear is a bad idea, just that it is advanced API for people who really understand how the streams system works in detail.

@philippjfr
Copy link
Member Author

Done in PR referenced above.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants