-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.library-asynctype-documentationA request to add or improve documentationA request to add or improve documentation
Description
See StreamController.addStream() documentation:
sdk/sdk/lib/async/stream_controller.dart
Lines 295 to 297 in 4c3e916
| /// Events must not be added directly to this controller using [add], | |
| /// [addError], [close] or [addStream], until the returned future | |
| /// is complete. |
May be it makes sense to add that in case of MultiStreamController it's also addSync, addErrorSync and closeSync?
StreamController.close():
sdk/sdk/lib/async/stream_controller.dart
Lines 252 to 253 in 4c3e916
| /// No further events can be added to a closed stream. | |
| /// |
What about done event? Calling
close() twice doesn't produce any issues so it looks like sending done event to the closed stream is allowed.
sdk/sdk/lib/async/stream_controller.dart
Lines 255 to 256 in 4c3e916
| /// It is completed when the stream listeners is done sending events, | |
| /// This happens either when the done event has been sent, |
Looks like a typo. Stream listeners are done sending events? May be listening? And there should be a dot at the end of line 255, not a comma.
sdk/sdk/lib/async/stream_controller.dart
Lines 259 to 260 in 4c3e916
| /// A stream controller will not complete the returned future until all | |
| /// listeners present when the done event is sent have stopped listening. |
It's hard to understand what is meant. Please, rewrite.
Edit:
Also the folowing.
sdk/sdk/lib/async/stream_controller.dart
Lines 267 to 268 in 4c3e916
| /// If no one listens to a non-broadcast stream, | |
| /// or the listener pauses and never resumes, |
Seems that "non-broadcast" here should be removed. It's possible to create a broadcast multi-listener stream by
Stream.multi but the above will be true for it.
cc @lrhn
Metadata
Metadata
Assignees
Labels
area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.library-asynctype-documentationA request to add or improve documentationA request to add or improve documentation