BREAKING CHANGE: Removal of StreamController.broadcast

376 views
Skip to first unread message

Florian Loitsch

unread,
Apr 15, 2013, 7:05:17 PM4/15/13
to General Dart Discussion
With r21499 we removed the StreamController.broadcast constructor.

The StreamController.broadcast streams had nasty properties that could easily lead to missed events and similar hard-to-debug conditions.
We initially added this class for the html-library, but ended up not needing it there. By removing this class we can have a much cleaner contract for Streams.
We still kept the asBroadcastStream method. Its behavior is slightly different and saner than the one of StreamController.broadcast.
In most cases you can try to migrate to `asBroadcastStream` if you need to attach multiple listeners.
--
Give a man a fire and he's warm for the whole day,
but set fire to him and he's warm for the rest of his life. - Terry Pratchett

Jackie Han

unread,
Apr 16, 2013, 3:28:09 AM4/16/13
to mi...@dartlang.org
I think Stream mode like Message Service(eg JMS), single mode like point-to-point, broadcast like pub-sub.
Broadcast may miss event, if there is no subscriber. 
But broadcast stream from stream.asBroadcastStream will not miss event if there is not subscriber. This is not like pub-sub.

在 2013年4月16日星期二UTC+8上午7时05分17秒,Florian Loitsch写道:
Reply all
Reply to author
Forward
0 new messages