Skip to content

Please update StreamController documentation #56908

@sgrekhov

Description

@sgrekhov

See StreamController.addStream() documentation:

/// 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():

/// 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.

/// 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.

/// 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.

/// 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.library-asynctype-documentationA request to add or improve documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions