Let's say I'm in another code that knows nothing about the first two click handlers, but I'm registering another one.
Can I find out that a thread has two listeners?
No, you canโt. You can extend the class of the stream or wrap it and provide this function yourself, but this does not seem like a good design choice, because I do not think that the listener should know about other listeners. What are you trying to do for sure? Perhaps there is a better way than letting the audience know about each other.
Can I pause or cancel all other subscribers?
You can cancel / pause / resume only the subscriber with whom you are dealing. Again, you probably shouldn't touch other listeners, but I think you could wrap / extend the Stream class to have this behavior.
If I write button.onClick.asBroadcastStream () again in another place, does it point to the same stream that was used mainly?
No, at least not in the current version of the SDK. Therefore, unfortunately, you need to store the link to this broadcast stream somewhere and refer to it, because calling asBroadcastStream() several times will not produce the result that you expect. (Note: at least based on quick testing: http://d.pr/i/Ip0K , although the documentation seems to point to different ones, I still have to check a little more when I find the time).
Can I tell in one of the handlers so as not to transfer the event to another broadcast listener?
Well, there is stopPropagation() on the HTML land, which means the event will not propagate to other elements, but that is probably not what you were looking for.
In order to stop events from starting in other listeners, it is necessary that the order of the listeners be called. I believe that order is the procedure for registering these students. From a design point of view, I donโt think it would be nice to let the listener cancel / pause others.
Distributing events in HTML makes sense, since it is connected with a hierarchy, but we donโt have it here (and even in the case of events in HTML, there can be several listeners for one element).
It is not possible to assign weight to listeners or determine the order of importance, so it is not surprising that there is no way to stop the event.
Instead of letting the listeners know about each other and manipulate each other, perhaps you should try to think of another way to approach your problem (whatever that may be).
Is it a consumer?
StreamConsumer is just a class that you can implement if you want to allow the transfer of other streams to your class.