[Streams] Support closed field/getter and cancelOnError config #37
Replies: 2 comments 3 replies
-
|
I don't understand the utility of having the The use case you describe doesn't seem quite in line with the functionality that a resource provides. In addition, this also applies to the stream when it goes into the What is the use case where you need to show something different when the stream has been closed? |
Beta Was this translation helpful? Give feedback.
-
|
Your point about Regarding |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I suggest adding:
bool? cancelOnErrorparam when creating the resource (only if it is a stream)bool closedfield to the resource states of a stream. This way it is possible to adapt what is displayed in thebuildmethod.isClosedorclosedgetter, such asresource.isClosed(thus no extra arg to the callbacks)?How would you implement this? Maybe we should have two separate resource classes, one for streams and the other one for futures? Note: A while ago I attempted this by splitting
Resourceinto two classes: Resource and StreamResource. However, it resulted in some duplicated code.More in general, what is your opinion about supporting
cancelOnErrorandcancel?Beta Was this translation helpful? Give feedback.
All reactions