[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.
-
I suggest adding:
bool? cancelOnError
param when creating the resource (only if it is a stream)bool closed
field to the resource states of a stream. This way it is possible to adapt what is displayed in thebuild
method.isClosed
orclosed
getter, 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
Resource
into two classes: Resource and StreamResource. However, it resulted in some duplicated code.More in general, what is your opinion about supporting
cancelOnError
andcancel
?Beta Was this translation helpful? Give feedback.
All reactions